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