Skip to content

Commit

Permalink
Fix open-obs-studio.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Fleschutz committed Dec 3, 2021
1 parent 1896543 commit 1d5c57c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Scripts/open-obs-studio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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))"
Expand Down

0 comments on commit 1d5c57c

Please sign in to comment.