mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-08 00:29:11 +02:00
Improve open-git-extensions.ps1
This commit is contained in:
parent
5ed926b608
commit
24a26a718c
@ -11,16 +11,17 @@
|
|||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
#>
|
#>
|
||||||
|
|
||||||
function TryLaunching { param($Path)
|
function TryExec { param($Folder, $Binary)
|
||||||
if (test-path "$Path" -pathType leaf) {
|
if (test-path "$Folder/$Binary" -pathType leaf) {
|
||||||
start-process "$Path"
|
start-process "$Folder/$Binary" -WorkingDirectory "$Folder"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TryLaunching "C:\Program Files (x86)\GitExtensions\GitExtensions.exe"
|
TryExec "C:\Program Files (x86)\GitExtensions" "GitExtensions.exe"
|
||||||
TryLaunching "C:\Program Files\GitExtensions\GitExtensions.exe"
|
TryExec "C:\Program Files\GitExtensions" "GitExtensions.exe"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "Sorry, I can't find Git Extensions"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
Loading…
Reference in New Issue
Block a user