From 5b08d4ef11e5d6b9c09eccb79eda42eb8a757036 Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Fri, 28 Jun 2024 20:53:18 -0700 Subject: [PATCH] feat: Namespace.get_Function ( Fixes #1140 ) --- Types/Namespace/get_Function.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Types/Namespace/get_Function.ps1 diff --git a/Types/Namespace/get_Function.ps1 b/Types/Namespace/get_Function.ps1 new file mode 100644 index 000000000..d5d050cf8 --- /dev/null +++ b/Types/Namespace/get_Function.ps1 @@ -0,0 +1,7 @@ +if (-not $this.Pattern) { return } +if (-not $global:AllFunctionsOrFilters) { + $global:AllFunctionsOrFilters = $global:ExecutionContext.SessionState.InvokeCommand.GetCommands('*','Function,Filter',$true) +} +foreach ($cmdPattern in $this.Pattern) { + $global:AllFunctionsOrFilters -match $cmdPattern +} \ No newline at end of file