Wednesday, January 15, 2014

Learning Powershell - End a process

UI Way:
1. Ctrl-alt-del
2. Open Task Manager
3. Find the Process
4. Right-click -> End Process

Powershell way:
$name = "comm*"
get-process | where-object {$_.Name -like $name} | kill -name {$_.Name}

This is ending all processes with a name comm*. My specific goal here was to shut down all Lync 2010 processes. For some reason it opens several processes, and none of them actually show the Lync client. This happens sometimes, not sure why. But before, i had to go through and kill ALL of the "communicator.exe" processes. Now this one line script does it.

No comments:

Post a Comment

There was an error in this gadget