mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-26 01:43:37 +01:00
Add close-notepad-app.ps1 and minimize-notepad-app.ps1
This commit is contained in:
parent
ce5311e427
commit
6f1b4bbcd7
19
Scripts/close-notepad-app.ps1
Executable file
19
Scripts/close-notepad-app.ps1
Executable file
@ -0,0 +1,19 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Closes the Notepad app
|
||||
.DESCRIPTION
|
||||
This script closes the Notepad application gracefully.
|
||||
.EXAMPLE
|
||||
PS> ./close-notepad-app
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
TaskKill /im Notepad
|
||||
if ($lastExitCode -ne "0") {
|
||||
& "$PSScriptRoot/speak-english.ps1" "Sorry, Notepad is already closed."
|
||||
exit 1
|
||||
}
|
||||
exit 0 # success
|
15
Scripts/minimize-notepad-app.ps1
Executable file
15
Scripts/minimize-notepad-app.ps1
Executable file
@ -0,0 +1,15 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Minimizes the Notepad app
|
||||
.DESCRIPTION
|
||||
This script minimizes the Notepad application.
|
||||
.EXAMPLE
|
||||
PS> ./minimize-notepad-app
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
get-process Notepad | Set-WindowStyle -Style Minimize
|
||||
exit 0 # success
|
@ -1,10 +1,10 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Starts Notepad
|
||||
Launches the Notepad app
|
||||
.DESCRIPTION
|
||||
This script launches the Notepad application.
|
||||
.EXAMPLE
|
||||
PS> ./open-notepad
|
||||
PS> ./open-notepad-app
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
Loading…
Reference in New Issue
Block a user