Tutorials for Writing Cmdlets
This section contains tutorials for writing cmdlets. These tutorials include the code needed to write the cmdlets, plus an explanation of why the code is needed. These topics will be very helpful for those who are just starting to write cmdlets.
Important
For those who want code examples with less description, see Cmdlet Samples.
In This Section
GetProc Tutorial - This tutorial describes how to define a cmdlet class and add basic functionality such as adding parameters and reporting errors. The cmdlet described in this tutorial is very similar to the Get-Process cmdlet provided by Windows PowerShell.
StopProc Tutorial - This tutorial describes how to define a cmdlet and add functionality such as user prompts, wildcard support, and the use of parameter sets. The cmdlet described here performs the same task as the Stop-Process cmdlet provided by Windows PowerShell.
SelectStr Tutorial - This tutorial describes how to define a cmdlet that accesses a data store. The cmdlet described here performs the same task as the Select-String cmdlet provided by Windows PowerShell.
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för