Skip to content

Commit bf2220d

Browse files
StartAutomatingStartAutomating
authored andcommitted
OBS Source Commands - Fixing -NoResponse (Fixes #136)
Also fixing Add vs Set return behaviors
1 parent 1bef256 commit bf2220d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Commands/Sources/Set-OBSDisplaySource.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ function Set-OBSDisplaySource {
115115
inputName = $myParameters["Name"]
116116
inputKind = "monitor_capture"
117117
inputSettings = $myParameterData
118+
NoResponse = $myParameters["NoResponse"]
118119
}
119120
# If -SceneItemEnabled was passed,
120121
if ($myParameters.Contains('SceneItemEnabled')) {
@@ -156,7 +157,7 @@ function Set-OBSDisplaySource {
156157
# update the input settings
157158
$sceneItem.Input.Settings = $addSplat.inputSettings
158159
$sceneItem # and return the scene item.
159-
$outputAddedResult = $null
160+
$outputAddedResult = $null
160161
}
161162
}
162163
# If the output was still an error
@@ -166,7 +167,8 @@ function Set-OBSDisplaySource {
166167
}
167168
}
168169
# Otherwise, if we had a result
169-
elseif ($outputAddedResult) {
170+
if ($outputAddedResult -and
171+
$outputAddedResult -isnot [Management.Automation.ErrorRecord]) {
170172
# get the input from the scene.
171173
Get-OBSSceneItem -sceneName $myParameters["Scene"] |
172174
Where-Object SourceName -eq $name

0 commit comments

Comments
 (0)