Matrix-Style Rain in PowerShell

Fill the console with scrolling green characters for a fun effect.

WindowsTerminalASCII artpowershellLow risk
Run the one-liner to start; press Ctrl+C to stop the rain.

01Command

Command
$ while ($true) { $line = -join (1..80 | ForEach-Object { [char](Get-Random -Minimum 33 -Maximum 126) }); Write-Host $line -ForegroundColor Green; Start-Sleep -Milliseconds 60 }

02What it does

The loop builds a row of 80 random printable characters with Get-Random, writes it in green with Write-Host and pauses briefly with Start-Sleep. Change the range or the sleep to alter the density and speed. It is a fun demo of loops and .NET types.

03Risk

RiskLow risk
RequirementsWindows 10/11 with PowerShell 5.1 or PowerShell 7+
!Warning: The loop runs forever until interrupted and keeps the console busy; do not leave it running unattended.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Get-Random
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Documents random number and collection selection, used to build each row.
  • Start-Sleep
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Pauses script execution; controls the animation speed.

Last verified: 2026-09-20 · Category: Developer

06Related solutions