From 1f481c65b73701dcf65cdf725b83f15fe8528ef8 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 21 Oct 2021 15:52:34 +0200 Subject: [PATCH] Update close-program.ps1 --- Scripts/close-program.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/close-program.ps1 b/Scripts/close-program.ps1 index 655136e8..f2115785 100755 --- a/Scripts/close-program.ps1 +++ b/Scripts/close-program.ps1 @@ -47,7 +47,11 @@ try { start-sleep -milliseconds 100 stop-process -name $ProgramName -force -errorAction 'silentlycontinue' } - "✔️ closed $FullProgramName, stopped $($Processes.Count) process(es)" + if ($($Processes.Count) -eq 1) { + "✔️ $FullProgramName closed (1 process stopped)" + } else { + "✔️ $FullProgramName closed ($($Processes.Count) processes stopped)" + } exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"