PowerShell and DevOps

TMW12 Life Beyond Functions: Creating PowerShell Script Cmdlets (aka Advanced Functions)

11/20/2019

4:00pm - 5:15pm

Level: Introductory to Intermediate

Michael Wiley

Senior Customer Engineer

Microsoft

While functions in Windows PowerShell work very similar to other scripting languages, PowerShell Advanced Functions behave just like compiled cmdlets. Capabilities can be added to Advanced Functions that include help, advanced parameters, validation attributes, access to common parameters like "-Verbose" and "-ErrorAction", risk mitigation, dynamic parameters, and other capabilities that cmdlets natively support. The difference between authoring a compiled cmdlet and scripting an Advanced Function is that compiled cmdlets are .NET classes written in a .NET Framework language, whereas Advanced Functions are written in the PowerShell script language and borrow the native cmdlet functionality.

You will learn:

  • Write functions in PowerShell that will operate exactly like core cmdlets including access to common and risk mitigation parameters
  • Implement stricter organization and control of PowerShell code within the enterprise
  • Take advantage of controlling exact static and positional PowerShell parameter behavior