mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 05:26:47 +01:00
Fix open-obs-studio.ps1
This commit is contained in:
parent
1896543ea5
commit
1d5c57c758
@ -11,16 +11,16 @@
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
function TryLaunching { param($Path)
|
||||
function TryLaunching { param([string]$Path, [string]$Dir)
|
||||
if (test-path "$Path" -pathType leaf) {
|
||||
start-process "$Path"
|
||||
start-process -FilePath "$Path" -WorkingDirectory "$Dir"
|
||||
exit 0 # success
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
TryLaunching "C:\Program Files (x86)\OBS Studio\bin\64bit\obs64.exe"
|
||||
TryLaunching "C:\Program Files\OBS Studio\bin\64bit\obs64.exe"
|
||||
TryLaunching "C:\Program Files (x86)\OBS Studio\bin\64bit\obs64.exe" "C:\Program Files (x86)\OBS Studio\bin\64bit\"
|
||||
TryLaunching "C:\Program Files\OBS Studio\bin\64bit\obs64.exe" "C:\Program Files\OBS Studio\bin\64bit\"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
|
Loading…
Reference in New Issue
Block a user