Skip to content

Commit

Permalink
Handling -PassThru in filters
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed May 29, 2023
1 parent efaf5b1 commit 6e6d62c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Commands/Filters/Set-OBSColorFilter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ function Set-OBSColorFilter {
.EXAMPLE
Show-OBS -Uri .\Assets\obs-powershell-animated-icon.svg |
Set-OBSColorFilter -Opacity .5
.EXAMPLE
Show-OBS -Uri
#>

Expand Down Expand Up @@ -168,8 +166,15 @@ function Set-OBSColorFilter {
filterSettings = $myParameterData
}

if ($PassThru) {
$addSplat.Passthru = $true
if ($MyParameters["PassThru"]) {
$addSplat.Passthru = $MyParameters["PassThru"]
if ($MyInvocation.InvocationName -like 'Add-*') {
Add-OBSSourceFilter @addSplat
} else {
$addSplat.Remove('FilterKind')
Set-OBSSourceFilterSettings @addSplat
}
return
}
# Add the input.
$outputAddedResult = Add-OBSSourceFilter @addSplat *>&1
Expand Down

0 comments on commit 6e6d62c

Please sign in to comment.