Play a WAV sound from PowerShell with Media.SoundPlayer
Use .NET's SoundPlayer to play Windows' own notification WAVs — or your own — from any script, synchronously or in the background.
01Command
$ (New-Object Media.SoundPlayer 'C:\Windows\Media\Windows Notify.wav').PlaySync()02What it does
SoundPlayer only handles WAV files, which is fine because C:\Windows\Media contains dozens of classic system sounds. PlaySync() blocks until the sound finishes — right for step-by-step alerts — while Play() plays asynchronously and won't pause your script (but a script exit can cut it off; add Start-Sleep to let it finish). With LoadAsync() plus PlayLooping() you can hold a looping sound, and the same class accepts UNC or HTTP-served WAV paths.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- SoundPlayer Class | Microsoft LearnEvidence: Microsoft documents System.Media.SoundPlayer with Play/PlaySync methods for loading and playing WAV files.
Last verified: 2026-09-17 · Category: Media
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.