Skip to content

Instantly share code, notes, and snippets.

@bender-the-greatest
Created April 5, 2019 16:31
Show Gist options
  • Save bender-the-greatest/5624b86550aaa04a3a09ffefd7f7ad7b to your computer and use it in GitHub Desktop.
Save bender-the-greatest/5624b86550aaa04a3a09ffefd7f7ad7b to your computer and use it in GitHub Desktop.
Random-CatFact.ps1 - Reads a random cat fact out loud. Fun to run this with Invoke-Command on your co-workers' or boss' workstations when they aren't busy.
Add-Type -AssemblyName System.Speech
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$SpeechSynth.SelectVoice( 'Microsoft Zira Desktop' )
$CatFact = Invoke-RestMethod -UseBasicParsing https://catfact.ninja/fact
$SpeechSynth.speak( "Did you know? $($CatFact.fact)" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment