Skip to content

Commit 3d5143f

Browse files
StartAutomatingStartAutomating
authored andcommitted
Add-OBSMediaSource, adding -FitToScreen
1 parent 6ce46b5 commit 3d5143f

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Commands/Sources/Add-OBSMediaSource.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ function Add-OBSMediaSource {
6767
# If not set, you will get an error if a source with the same name exists.
6868
[Parameter(ValueFromPipelineByPropertyName)]
6969
[switch]
70-
$Force
70+
$Force,
71+
# If set, will fit the input to the screen.
72+
[Parameter(ValueFromPipelineByPropertyName)]
73+
[switch]
74+
$FitToScreen
7175
)
7276
dynamicParam {
7377
$baseCommand =
@@ -170,7 +174,13 @@ dynamicParam {
170174
$outputAddedResult = Add-OBSInput @addSplat
171175
if ($outputAddedResult) {
172176
Get-OBSSceneItem -sceneName $myParameters["Scene"] |
173-
Where-Object SourceName -eq $name
177+
Where-Object SourceName -eq $name |
178+
Foreach-Object {
179+
if ($FitToScreen) {
180+
$_.FitToScreen()
181+
}
182+
$_
183+
}
174184
}
175185

176186
}

0 commit comments

Comments
 (0)