mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-30 21:54:43 +02:00
Improve close-calculator.ps1
This commit is contained in:
parent
24a26a718c
commit
8769106967
@ -1,8 +1,8 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Closes the calculator program
|
Closes the calculator app
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This script closes the calculator program gracefully.
|
This script closes the calculator application gracefully.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./close-calculator
|
PS> ./close-calculator
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -11,5 +11,10 @@
|
|||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
#>
|
#>
|
||||||
|
|
||||||
& "$PSScriptRoot/close-program.ps1" "Calculator" "Calculator" "calc"
|
try {
|
||||||
exit 0 # success
|
taskkill /im "Calculator.exe" /f /t
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "Sorry, calculator isn't running"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user