Abhi
Abhi

Reputation: 351

How to find details related to the running windows apps using Powershell?

Currently, I am working on the task that nrequires the running windows apps details using powershell script. I found pointers in this regard that can give me the "Process" on which all the windows apps are getting hosted while they are running. More specifically - I can understand that when any windows app runs on "Windows 8" machine it gets hosted to the process named - WWAHost.exe .

Now, I need to find out its in depth detail such as "App name", how we can get that using powershell script? I tried with Get-Process & Get-Member commands but those seems to be not helpful to get the actual app name (or might be i am missing something while scripting these commands). Some pointers on this would be really helpful. :)

Upvotes: 0

Views: 2440

Answers (3)

S. Bishop
S. Bishop

Reputation: 11

If you run:

Get-Process | FT -Autosize

This will give you the processes that are running, and put them in a table format.

Upvotes: 1

S. Bishop
S. Bishop

Reputation: 11

The way I read this is that you are running a PowerShell cmdlet.

[prompt] $procs = Get-WMIObject win32_process

[prompt] $procs[0] | Get-Member

This will not return the process. What this will return the following:

The following is an error; that states that PowerShell does not know what to do with '[prompt]'

Unable to find type [prompt]. Make sure that the assembly that contains this type is loaded. At line:2 char:1 + [prompt] $procs[0] | Get-Member + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (prompt:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound

I think what you want it is something like this:

$procs = Get-WMIObject win32_process

$procs[0]

This will give you the first process that returns from the Cmdlet that is ran. I hope this helps.

Upvotes: 0

Number8
Number8

Reputation: 12870

[prompt] $procs = Get-WMIObject win32_process  
[prompt] $procs[0] | Get-Member

You will find properties such as Name, CommandLine, ExecutablePath, etc.
Is this what you are looking for?

Upvotes: 0

Related Questions