Tuesday, July 6, 2010

Have Some Fun With Powershell

Wow, two posts in one day. That's a record.

So I was on Twitter and saw @alasta tweet about Get-Process | Stop-Process, of which I replied with Get-Process | Get-Random | Stop-Process, basically Process roulette as we call it.

Was then thinking too bad that Stop-Process doesn't support remote computers, however have no fear, the built in taskkill of Windows will do the trick.

First off, I do not recommend using this, second thing to say it is kind of funny. Try this next time you want to annoy someone:

Get-Process -ComputerName $colleaguepc | Get-Random | ForEach-Object {Taskkill /f /s \\$colleaguepc /pid $_.pid }

Again, use at your own risk!

No comments:

Post a Comment