Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 1.44 KB

getproc03-csharp-sample-code.md

File metadata and controls

30 lines (23 loc) · 1.44 KB
description ms.date ms.topic title
GetProc03 (C#) Sample Code
09/13/2016
reference
GetProc03 (C#) Sample Code

GetProc03 (C#) Sample Code

The following code shows the implementation of a Get-Process cmdlet that can accept pipelined input. This implementation defines a Name parameter that accepts pipeline input, retrieves process information from the local computer based on the supplied names, and then uses the WriteObject(System.Object,System.Boolean) method as the output mechanism for sending objects to the pipeline.

Note

You can download the C# source file (getprov03.cs) for this Get-Proc cmdlet using the Microsoft Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components. For download instructions, see How to Install Windows PowerShell and Download the Windows PowerShell SDK. The downloaded source files are available in the <PowerShell Samples> directory.

Code Sample

:::code language="csharp" source="~/../powershell-sdk-samples/SDK-2.0/csharp/GetProcessSample03/GetProcessSample03.cs" range="11-78":::

See Also

Windows PowerShell Programmer's Guide

Windows PowerShell SDK