Situatie
How to check if a process is runnin and stop it using PowerShell script.
Solutie
$calculator = Get-Process calc -ErrorAction SilentlyContinue
if ($calculator) {
echo “running”
Stop-Process -processname “calc” -Force
echo “calc process stopped”
}
else {
echo “not running”
}
Remove-Variable calculator
Leave A Comment?