Man Chun Liew
Man Chun Liew

Reputation: 47

How to get name of process in background process with powershell script?

As question how to get name of process in background process with powershell script? How to find whether inside background process of the task manager can find the certain app name or not? For example in the image below, i need to check whether have this item in background process "NetOp 32 Host Application. (32 bit)"

enter image description here

Upvotes: 1

Views: 2872

Answers (1)

fdafadf
fdafadf

Reputation: 819

Task Manager shows FileDescription. You can game the same like that:

Get-Process | select @{Name='Name'; Expression={$_.MainModule.FileVersionInfo.FileDescription}}

It is possible to filter the result:

Get-Process | select @{Name='Name'; Expression={$_.MainModule.FileVersionInfo.FileDescription}} |? Name -match 'Visual'

My filtered results looks like:

Name
----
Microsoft Visual Studio 2019 Preview
Microsoft Visual Studio 2019 Preview

To check how many results you have, you can use Count property:

$filteredResults = Get-Process | select @{Name='Name'; Expression={$_.MainModule.FileVersionInfo.FileDescription}} |? Name -match 'Visual'
$filteredResults.Count

Upvotes: 2

Related Questions