@@ -59,7 +59,7 @@ $($myAttribute.ScriptBlock)
59
59
Out-File - Path $env: GITHUB_STEP_SUMMARY - Append
60
60
61
61
}
62
- Write-Warning " Skipping $ ( $MyInvocation.MyCommand ) :The last commit did not match $ ( $myRegex ) "
62
+ Write-Warning " Skipping $ ( $MyInvocation.MyCommand ) : The $CheckIfThisIsValid was not valid "
63
63
return
64
64
}
65
65
}
@@ -342,6 +342,15 @@ switch -regex ($myVerb) {
342
342
Where-Object FilterName -Match $FilterNamePattern
343
343
}
344
344
}
345
+ ' Remove' {
346
+ if ($SourceName ) {
347
+ Get-OBSInput |
348
+ Where-Object InputName -eq $SourceName |
349
+ Get-OBSSourceFilterList |
350
+ Where-Object FilterName -Match $FilterNamePattern |
351
+ Remove-OBSSourceFilter
352
+ }
353
+ }
345
354
' (?>Add|Set)' {
346
355
$ShaderSettings = [Ordered ]@ {}
347
356
:nextParameter foreach ($parameterMetadata in $MyInvocation.MyCommand.Parameters [@ ($psBoundParameters.Keys )]) {
@@ -368,8 +377,23 @@ switch -regex ($myVerb) {
368
377
}
369
378
}
370
379
371
- if ($myVerb -eq ' Add' ) {
380
+ if (-not $script :CachedShaderFilesFromCommand ) {
381
+ $script :CachedShaderFilesFromCommand = @ {}
382
+ }
383
+
384
+ if ($Home -and -not $script :CachedShaderFilesFromCommand [$shaderName ]) {
385
+ $MyObsPowerShellPath = Join-Path $home " .obs-powershell"
386
+ $ThisShaderPath = Join-Path $MyObsPowerShellPath " $shaderName .shader"
387
+ $shaderText | Set-Content - LiteralPath $ThisShaderPath
388
+ $script :CachedShaderFilesFromCommand [$shaderName ] = Get-Item - LiteralPath $ThisShaderPath
389
+ }
390
+ if ($script :CachedShaderFilesFromCommand [$shaderName ]) {
391
+ $ShaderFilterSplat.ShaderFile = $script :CachedShaderFilesFromCommand [$shaderName ].FullName
392
+ } else {
372
393
$ShaderFilterSplat.ShaderText = $shaderText
394
+ }
395
+
396
+ if ($myVerb -eq ' Add' ) {
373
397
Add-OBSShaderFilter @ShaderFilterSplat
374
398
} else {
375
399
Set-OBSShaderFilter @ShaderFilterSplat
0 commit comments