Process can be viewed easily in Powershell with Get-Process command. This command is useful, but it has some shortcomings -
1. It does not show the command-line and arguments passed to the command.
2. It does not show the Path of command.
Due to these shortcomings, I started looking for some option by which we can get the list of processes with complete details. The search completed and it came with WMI and Powershell combination. Below is the single line which can solve this problem.
Get-WmiObject Win32_process | select ParentProcessId, ProcessId, Name, Commandline | ft
Based on the above, you can write a script which could kill processes by specific application, but be careful, killing a operating system process might shutdown the machine.
Happy scripting!!
1. It does not show the command-line and arguments passed to the command.
2. It does not show the Path of command.
Due to these shortcomings, I started looking for some option by which we can get the list of processes with complete details. The search completed and it came with WMI and Powershell combination. Below is the single line which can solve this problem.
Get-WmiObject Win32_process | select ParentProcessId, ProcessId, Name, Commandline | ft
Based on the above, you can write a script which could kill processes by specific application, but be careful, killing a operating system process might shutdown the machine.
Happy scripting!!
Your website is very beautiful or Articles. I love it thank you for sharing for everyone. Curso de Python intermediate and advanced
ReplyDelete