mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-03 11:34:54 -06:00
update runspace function gathering logic
This commit is contained in:
parent
a6c8337049
commit
4682db2ed6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user