Hardcore mode in PowerShell is the equivalent to legendary mode in Skyrim. One wrong move and you get to start over. But how do you enable it in PowerShell?
Start by finding a coworker that is pretty cocky with PowerShell. Remotely edit their PowerShell profile and paste in the following code at the end of their profile:
$ExecutionContext.InvokeCommand.CommandNotFoundAction = { Stop-Computer -Force }
PowerShell will continue to work perfectly…until they mistype a command. When that happens, their computer will immediately shutdown. Happy Friday!
I used to be a coder like yourself until I took an arrow to the knee.
Okay that is just pure evil.
I made the mistake of leaving it in my powershell profile yesterday after testing. I was so aggravated when I mistyped that first time! 🙂
Fus ro DOH! *computer shuts off*
I can just imagine how much fun this would be. The real hardcore bit about this would be keeping your composure while they tried to figure out what happened. One outburst of laughter and the jokes over!
Definite day-brightener. Thanks Joseph, for sharing!
You made me spit my coffee out! 🙂
and no problem! Thanks to Johan for showing me this first.
I am glad you don’t work with me anymore. it took me a hour to find out why every time I opened powershell my computer started playing tones.