Is it possible to a get a list of the currently defined functions in a powershell runspace?
Runspace
have SessionStateProxy
property, which allows you to interact with Runspace
SessionState
:
$PowerShell = [PowerShell]::Create()$PowerShell.AddScript{ function SomeFunction {} function SomeOtherFunction {}}.Invoke()$PowerShell.Runspace.SessionStateProxy.InvokeCommand.GetCommands('*','Function',$true)