mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 16:03:22 +01:00
Update close-notepad-app.ps1
This commit is contained in:
parent
6f1b4bbcd7
commit
c754bae0bf
@ -28,7 +28,7 @@ Computer, open `name` browser
|
||||
Computer, open `name` app
|
||||
--------------------------
|
||||
* this launches the given application.
|
||||
* replace `name` by: "Calculator", "Git Extensions", "Netflix", "Spotify", "Thunderbird", or "Visual Studio".
|
||||
* replace `name` by: "Calculator", "Git Extensions", "Netflix", "Notepad", "Spotify", "Thunderbird", or "Visual Studio".
|
||||
* when finished use: *Computer, close `name` app* to stop the application.
|
||||
|
||||
|
||||
|
@ -11,9 +11,5 @@
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
TaskKill /im Notepad
|
||||
if ($lastExitCode -ne "0") {
|
||||
& "$PSScriptRoot/speak-english.ps1" "Sorry, Notepad is already closed."
|
||||
exit 1
|
||||
}
|
||||
& "$PSScriptRoot/close-program.ps1" "Notepad" "notepad" "notepad"
|
||||
exit 0 # success
|
||||
|
@ -36,7 +36,6 @@ try {
|
||||
start-sleep -milliseconds 100
|
||||
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
|
||||
} else {
|
||||
|
||||
$Processes = get-process -name $ProgramAliasName -errorAction 'silentlycontinue'
|
||||
if ($Processes.Count -eq 0) {
|
||||
throw "$FullProgramName is not started yet"
|
||||
|
@ -1,15 +0,0 @@
|
||||
<#
|
||||
.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
|
Loading…
Reference in New Issue
Block a user