Yes, you can use the Get-Process cmdlet to check if a process is running.
Get-Process
if (Get-Process -Name "notepad" -ErrorAction SilentlyContinue) { Write-Output "Notepad is running." } else { Write-Output "Notepad is not running." }
1.1k questions
696 answers
482 comments
193k users
Related Activities
Categories
Most popular tags