mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Add open-microsoft-paint.ps1 and close-microsoft-paint.ps1
This commit is contained in:
parent
e9a860bc3c
commit
2386fa4df9
15
Scripts/close-microsoft-paint.ps1
Normal file
15
Scripts/close-microsoft-paint.ps1
Normal 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
|
20
Scripts/open-microsoft-paint.ps1
Normal file
20
Scripts/open-microsoft-paint.ps1
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user