add startup command line params for obs
This commit is contained in:
1 parent
39963666b8
commit
1472f3538b
1 file changed
+8
-2
@@ -10,7 +10,8 @@ function Open-If-Not-Already {
|
|||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[string]$Path,
|
[string]$Path,
|
||||||
[string]$ProcessName,
|
[string]$ProcessName,
|
||||||
[string]$WorkingDirectory = (Get-Location).Path
|
[string]$WorkingDirectory = (Get-Location).Path,
|
||||||
|
[string[]]$Args = $null
|
||||||
)
|
)
|
||||||
|
|
||||||
if (-not $ProcessName) {
|
if (-not $ProcessName) {
|
||||||
@@ -19,14 +20,19 @@ function Open-If-Not-Already {
|
|||||||
|
|
||||||
if (-not (Get-Process -Name "$ProcessName" -ErrorAction SilentlyContinue)) {
|
if (-not (Get-Process -Name "$ProcessName" -ErrorAction SilentlyContinue)) {
|
||||||
Write-Output "Starting $ProcessName ($Path) ..."
|
Write-Output "Starting $ProcessName ($Path) ..."
|
||||||
|
if ($Args -eq $null) {
|
||||||
Start-Process "$Path" -WorkingDirectory "$WorkingDirectory"
|
Start-Process "$Path" -WorkingDirectory "$WorkingDirectory"
|
||||||
|
} else {
|
||||||
|
Write-Output "Opening with args $Args"
|
||||||
|
Start-Process "$Path" -WorkingDirectory "$WorkingDirectory" -ArgumentList "$Args"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Output "$ProcessName is already running."
|
Write-Output "$ProcessName is already running."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Open-If-Not-Already -Path "$OBS_PATH" -WorkingDirectory (Get-Item "$OBS_PATH").DirectoryName
|
Open-If-Not-Already -Path "$OBS_PATH" -WorkingDirectory (Get-Item "$OBS_PATH").DirectoryName -Args $("--profile", "rec-gaming", "--collection", "rec-gaming", "--scene", "evolution")
|
||||||
Open-If-Not-Already -Path "$FOOBAR_PATH"
|
Open-If-Not-Already -Path "$FOOBAR_PATH"
|
||||||
Open-If-Not-Already -Path "$MODRINTH_PATH"
|
Open-If-Not-Already -Path "$MODRINTH_PATH"
|
||||||
Open-If-Not-Already -Path "$BONGOCAT_LAUNCH_PATH" -ProcessName "$BONGOCAT_PROCESS_NAME"
|
Open-If-Not-Already -Path "$BONGOCAT_LAUNCH_PATH" -ProcessName "$BONGOCAT_PROCESS_NAME"
|
||||||
Reference in new issue
Block a user