RunSpace03 (VB.NET) Code Sample


Here is the VB.NET source code for the console application described in Creating a Console Application That Runs a Specified Script [ps]. This sample uses the RunspaceInvoke class to execute a script that retrieves process information for the list of process names passed into the script. It shows how to pass input objects to a script and how to retrieve error objects as well as the output objects.


You can download the VB.NET source file (runspace03.vb) for this sample by using the Windows Software Development Kit for Windows Vista and Microsoft .NET Framework 3.0 Runtime Components. For download instructions, see How to Install Windows PowerShell and Download the Windows PowerShell SDK [delete].

The downloaded source files are available in the <PowerShell Samples> directory.