| description | StopProcessSample04 (C#) Sample Code |
|---|---|
| ms.date | 09/13/2016 |
| ms.topic | reference |
| title | StopProcessSample04 (C#) Sample Code |
Here is the complete C# sample code for the StopProc04 sample cmdlet. This is the code for the
Stop-Process cmdlet described in
Adding Parameter Sets to a Cmdlet. The
Stop-Process cmdlet is designed to stop processes that are retrieved using the Get-Proc cmdlet
(described in Creating Your First Cmdlet).
Note
You can download the C# (stopprocesssample04.cs) source file for this Stop-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 language="csharp" source="~/../powershell-sdk-samples/SDK-2.0/csharp/StopProcessSample04/StopProcessSample04.cs" range="11-435":::