Is it possible to a get a list of the currently defined functions in a powershell runspace? Is it possible to a get a list of the currently defined functions in a powershell runspace? powershell powershell

Is it possible to a get a list of the currently defined functions in a powershell runspace?


Does the function PSProvider work for your needs?

Get-ChildItem function:


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)