If you are feeling a bit mischievous today, why not turn your co-worker’s computer into an audio replica of R2D2! Remotely edit their PowerShell profile and paste in the following code at the end of their profile:
function prompt { 20..40 | ForEach-Object { $frequency = Get-Random -Minimum 400 -Maximum 10000 $duration = Get-Random -Minimum 100 -Maximum 1000 [Console]::Beep($frequency, $duration) } }
The next time they launch PowerShell, their console will randomly make 21 beeps. Each beep is a random length and pitch.
The beeping function came from this great PowerShell resource. If you haven’t, consider subscribing to their blog for a daily PowerShell tip.
Have a fun Friday and aggravate teach some coworkers with this PowerShell prank.