Created
February 26, 2019 20:14
-
-
Save webtroter/f31544ce9bbd506198496c91518a3998 to your computer and use it in GitHub Desktop.
PowerShell Prank
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
# 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