Windows PowerShell is a powerful tool that is developed by Microsoft for purposes of task automation and configuration management. This is based on the .NET framework and it includes a command-line shell and a scripting language. Windows PowerShell is designed especially for system administrators. If you are a windows administrator and if you know PowerShell very well and you can simplify and automate tedious and repetitive tasks by creating scripts and combining multiple commands together. These Multiple Commands are called as cmdlets. Using PowerShell cmdlets, we can do Complex configuration like joining hundreds of Client computers to Active directory. You can also do a simple normal task using PowerShell.
Normally we face many common issues while using a computer, Particularly the Unresponsive program increase our BP, in that time windows gives us two options, one is to close and other is to wait for the Program to respond. Many of us don’t have patience so we choose the first option to Forcefully close the Unresponsive program. For Closing, we usually use Task manager. In task manager we can find the Unresponsive program Process easily, once we find the process, we end the task by a single click. Today this guide will show you how do the same task using PowerShell.
Kill a Process Using PowerShell
Open PowerShell in admin mode Type Get-process Command and hit enter, this command will show the list of running Process.
If any Program got stuck or not responding, then that process will considered as BadThread Using PowerShell we need to find the BadThread.exe Process.
Type the following command to achieve this get-process BadTh* You get the result like this
Handles NPM(K)   PM(K)     WS(K)   VM(M)  CPU(s) Id    ProcessName
     990        82   166092     147808  1,329.66     9456       BadThread
Find the Program name which you want to do forcefully stop and note the process ID, From the above result, you can get the Process ID.
Then type the following command to stop the exact process.
stop-process -id 9456
Once you entered the command the process will stop and you can reopen the program to verify its working or not.