Powershell – How to get list of running applications using PowerShell or VBScript

powershellscriptingvbscript

I need to programmatically get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript.

All I could find so far is how to list processes using VBScript and WMI.

Best Solution

This gets you close in PowerShell:

get-process | where-object {$_.mainwindowhandle -ne 0} | select-object name, mainwindowtitle

Or the shorter version:

gps | ? {$_.mainwindowhandle -ne 0} | select name, mainwindowtitle