Skip to content

Commit 6897cf1

Browse files
author
James Brundage
committed
Show-OBS: Adding -FitToScreen (re #66)
1 parent 9bd92cb commit 6897cf1

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Commands/Show-OBS.ps1

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,23 @@ function Show-OBS {
5454
# If not set, you will get an error if a source with the same name exists.
5555
[Parameter(ValueFromPipelineByPropertyName)]
5656
[switch]
57-
$Force
57+
$Force,
58+
59+
# If set, will make the input become the size of the screen.
60+
[Parameter(ValueFromPipelineByPropertyName)]
61+
[switch]
62+
$FitToScreen
5863
)
5964

65+
begin {
66+
filter FitToScreenAndOutput {
67+
if ($FitToScreen -and $_.FitToScreen) {
68+
$_.FitToScreen()
69+
}
70+
$_
71+
}
72+
}
73+
6074
process {
6175
# If we had a -RootPath
6276
if ($RootPath) {
@@ -137,14 +151,14 @@ function Show-OBS {
137151
"
138152
$SourceParameter.Uri = $htmlPath
139153
$SourceParameter.CSS = $css
140-
Add-OBSBrowserSource @SourceParameter
154+
Add-OBSBrowserSource @SourceParameter | FitToScreenAndOutput
141155
} else {
142-
Add-OBSBrowserSource @SourceParameter
156+
Add-OBSBrowserSource @SourceParameter | FitToScreenAndOutput
143157
}
144158

145159
} else {
146160
$SourceParameter.FilePath = $FilePath
147-
Add-OBSMediaSource @SourceParameter
161+
Add-OBSMediaSource @SourceParameter | FitToScreenAndOutput
148162
}
149163
}
150164
}

0 commit comments

Comments
 (0)