From 4682db2ed66c20f0082d95576a50b5821c72ad1a Mon Sep 17 00:00:00 2001 From: MyDrift Date: Tue, 15 Oct 2024 16:54:19 +0200 Subject: [PATCH] update runspace function gathering logic --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 7d07ffb6..e847644b 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -10,7 +10,7 @@ $InitialSessionState = [System.Management.Automation.Runspaces.InitialSessionSta $InitialSessionState.Variables.Add($hashVars) # Get every private function and add them to the session state -$functions = (Get-ChildItem function:\).where{$_.name -like "*winutil*" -or $_.name -like "*WPF*"} +$functions = Get-ChildItem function:\ | Where-Object { $_.Name -imatch 'winutil|Microwin|WPF' } foreach ($function in $functions) { $functionDefinition = Get-Content function:\$($function.name) $functionEntry = New-Object System.Management.Automation.Runspaces.SessionStateFunctionEntry -ArgumentList $($function.name), $functionDefinition