mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-19 03:01:15 +01:00
Add open-git-extensions.ps1 and close-git-extensions.ps1
This commit is contained in:
parent
9d240326c8
commit
9c30c0ccfe
15
Scripts/close-git-extensions.ps1
Normal file
15
Scripts/close-git-extensions.ps1
Normal file
@ -0,0 +1,15 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Closes Git Extensions
|
||||
.DESCRIPTION
|
||||
This script closes the Git Extensions application gracefully.
|
||||
.EXAMPLE
|
||||
PS> ./close-git-extensions
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
taskkill /im GitExtensions.exe
|
||||
exit 0 # success
|
28
Scripts/open-git-extensions.ps1
Normal file
28
Scripts/open-git-extensions.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Launches Git Extensions
|
||||
.DESCRIPTION
|
||||
This script launches the Git Extensions application.
|
||||
.EXAMPLE
|
||||
PS> ./open-git-extensions
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
function TryLaunching { param($Path)
|
||||
if (test-path "$Path" -pathType leaf) {
|
||||
start-process "$Path"
|
||||
exit 0 # success
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
TryLaunching "C:\Program Files (x86)\GitExtensions\GitExtensions.exe"
|
||||
TryLaunching "C:\Program Files\GitExtensions\GitExtensions.exe"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user