Skip to content

Commit

Permalink
feat: Namespace.get_Filter ( Fixes #1141 )
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Jun 29, 2024
1 parent 84ed813 commit 5649fdb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions PipeScript.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -2709,6 +2709,32 @@ $global:AllCmdlets -match $this.Pattern

</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Filter</Name>
<GetScriptBlock>
&lt;#
.SYNOPSIS
Gets the filters in the namespace.
.DESCRIPTION
Gets all the filters in the namespace.
#&gt;
param()
if (-not $this.Pattern) {
return
}
if (-not $global:AllFunctionsOrFilters) {
$global:AllFunctionsOrFilters = $global:ExecutionContext.SessionState.InvokeCommand.GetCommands('*','Function,Filter',$true)
}
foreach ($cmdPattern in $this.Pattern) {
foreach ($matchingCommand in $global:AllFunctionsOrFilters -match $cmdPattern) {
if ($matchingCommand.CommandType -eq 'Filter') {
$matchingCommand
}
}
}

</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Function</Name>
<GetScriptBlock>
Expand Down

0 comments on commit 5649fdb

Please sign in to comment.