September 29th, 2013

PowerTip: Examine PowerShell Runspace Initial Session State

Doctor Scripto
Scripter

Summary: Use the .NET Framework to examine the initial session state of a Windows PowerShell runspace.

Hey, Scripting Guy! Question How can I see the initial session state of the default Windows PowerShell runspace?

Hey, Scripting Guy! AnswerUse the RunSpace class, and examine the InitialSessionState property from the default Runspace object:

 [System.Management.Automation.Runspaces.Runspace]::DefaultRunspace.InitialSessionState 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.