Text-to-speech in PowerShell with System.Speech
No third-party tools needed: .NET's SpeechSynthesizer speaks any text through your speakers — useful for audible script notifications.
01Command
$ Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('Backup finished successfully.')02What it does
System.Speech ships with .NET Framework, so every Windows PowerShell installation already has it; Add-Type just loads the assembly into the session. Beyond Speak(), the synthesizer supports SpeakAsync for non-blocking output, SetOutputToWaveFile to render the speech to a WAV file, and SelectVoice to pick an installed voice. Note the newer .NET (Core) 'PowerShell 7' uses a different assembly (System.Speech is Windows-only), so this is most reliable in the built-in Windows PowerShell 5.1.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- SpeechSynthesizer Class | Microsoft LearnEvidence: Microsoft documents System.Speech.Synthesis.SpeechSynthesizer and its Speak method for text-to-speech synthesis in .NET.
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.