mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-18 19:07:04 +02:00
Improve close-program.ps1
This commit is contained in:
parent
b2e8acc282
commit
dcdd9a3e3d
@ -42,7 +42,7 @@ try {
|
|||||||
start-sleep -milliseconds 100
|
start-sleep -milliseconds 100
|
||||||
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
|
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
|
||||||
}
|
}
|
||||||
write-host -foregroundColor green "✔️ closed $FullProgramName, found ($($Processes.Count) process(es)"
|
"✔️ closed $FullProgramName, stopped $($Processes.Count) process(es)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user