Add open-microsoft-paint.ps1 and close-microsoft-paint.ps1

This commit is contained in:
Markus Fleschutz 2021-11-09 09:23:29 +01:00
parent e9a860bc3c
commit 2386fa4df9
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<#
.SYNOPSIS
Closes the Microsoft Paint app
.DESCRIPTION
This script closes the Microsoft Paint application gracefully.
.EXAMPLE
PS> ./close-microsoft-paint
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
taskkill /im mspaint.exe
exit 0 # success

View File

@ -0,0 +1,20 @@
<#
.SYNOPSIS
Launches the Microsoft Paint app
.DESCRIPTION
This script launches the Microsoft Paint application.
.EXAMPLE
PS> ./open-microsoft-paint
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
start-process mspaint.exe
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}