Windows Dev Center

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Runspace06 Sample

This sample shows how to add a module to an InitialSessionState object so that the module is loaded when the runspace is opened. The module provides a Get-Proc cmdlet (defined by the GetProcessSample02 Sample) that is run synchronously by using a PowerShell object.


This sample requires Windows PowerShell 2.0.


This sample demonstrates the following.


This sample creates a runspace that uses an InitialSessionState object to define the elements that are available when the runspace is opened. In this sample, a module that defines a Get-Proc cmdlet is added to the initial session state.

See Also

Community Additions

© 2015 Microsoft