Update the close-*.ps1 scripts

This commit is contained in:
Markus Fleschutz 2021-11-15 07:38:37 +01:00
parent 4ebf8910dc
commit 3c609c0687
13 changed files with 60 additions and 17 deletions

View File

@ -11,10 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
try {
taskkill /im "Calculator.exe" /f /t
exit 0 # success
} catch {
& "$PSScriptRoot/speak-english.ps1" "Sorry, calculator isn't running"
$result = TaskKill /im Calculator.exe /f /t
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close calculator"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im GitExtensions.exe
$result = TaskKill /im GitExtensions.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Git Extensions"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im msedge.exe
$result = TaskKill /im msedge.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Microsoft Edge"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im outlook.exe
$result = TaskKill /im outlook.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Microsoft Outlook"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im mspaint.exe
$result = TaskKill /im mspaint.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Microsoft Paint"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im WinStore.App.exe /f /t
$result = TaskKill /im WinStore.App.exe /f /t
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Microsoft Store"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im thunderbird.exe
$result = TaskKill /im thunderbird.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Mozilla Thunderbird"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im obs64.exe
$result = TaskKill /im obs64.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close OBS Studio"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /f /im CalendarApp.Gui.Win10.exe
$result = TaskKill /f /im CalendarApp.Gui.Win10.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close OneCalendar"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /f /im PaintStudio.View.exe
$result = TaskKill /im PaintStudio.View.exe /f
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Paint 3D"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /f /im 3DViewer.exe
$result = TaskKill /im 3DViewer.exe /f
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close 3D Viewer"
exit 1
}
exit 0 # success

View File

@ -11,5 +11,9 @@
https://github.com/fleschutz/PowerShell
#>
taskkill /im devenv.exe
$result = TaskKill /im devenv.exe
if ($result -ne 0) {
& "$PSScriptRoot/speak-english.ps1" "Sorry, can't close Visual Studio"
exit 1
}
exit 0 # success

View File

@ -24,7 +24,7 @@ try {
"⏳ Found $($Scripts.Count) scripts, exporting them to $TargetDir..."
foreach ($Script in $Scripts) {
& "$PSScriptRoot/convert-ps2md" "$Script" > "$TargetDir/$($Script.BaseName).md"
& "$PSScriptRoot/convert-ps2md.ps1" "$Script" > "$TargetDir/$($Script.BaseName).md"
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds