Skip to content

Instantly share code, notes, and snippets.

@webtroter
Created February 26, 2019 20:14
Show Gist options
  • Save webtroter/f31544ce9bbd506198496c91518a3998 to your computer and use it in GitHub Desktop.
Save webtroter/f31544ce9bbd506198496c91518a3998 to your computer and use it in GitHub Desktop.
PowerShell Prank
# WinRM needs to be enable:
# win qc
$Scriptblock = {
Add-Type -AssemblyName System.Speech
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$CatFact = (ConvertFrom-Json (Invoke-WebRequest -Uri 'http://catfact.ninja/facts' -UseBasicParsing)).data.fact
$SpeechSynth.Speak("did you know?")
$SpeechSynth.Speak($CatFact)
}
$testblock = {
Add-Type -AssemblyName System.Speech
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$SpeechSynth.Speak("Can you hear me?")
}
Invoke-Command -ComputerName $ComputerName -ScriptBlock $Scriptblock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment