Created
April 5, 2019 16:31
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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