Checklist for PowerShell Commandlets/Functions

When I write PowerShell functions, I like to make them as complete as possible. That includes leaving comment based help and adding support for as many use cases as possible. Here is a checklist of items I have found it useful to add to functions in order to make them as native and intuitive as possible.

 Capability
Present
Comment Based Help

-Synopsis

-Description

-Parameter(Multiples)

-Example(Multiples)

-Link(Multiples)

-Notes(Authorship)

-Outputs

-Inputs

Parameters

-mandatory or not

-type (String,Boolean)

-can it handle multiple (String[])

-Can it be be piped to (ValueFromPipeline=$true)

-Value from Pipeline by property Name(ValueFromPipelineByPropertyName=$true)

-Alias (Alias("CN","Computer"))

Cmdlet bindings configured

-Write-Verbose

-Write-Debug

-Write-Error

Properly set up to handle -whatif's

-https://foxdeploy.com/2014/09/04/adding-whatif-support-to-your-scripts-the-right-way-and-how-you-shouldnt-do-it/

comments on every line explaining how it functions

Begin-Process-End sections

Authorship

-Name,

-Email

-Date

-PSVer



Some relevant links to marking up PowerShell scripts
WTFM: Writing the Fabulous Manual: https://technet.microsoft.com/en-us/library/ff458353.aspx?f=255&MSPPError=-2147217396
PowerShell Readability: https://devblackops.io/on-powershell-readability/
Defining Parameters: https://technet.microsoft.com/en-us/library/jj554301.aspx

Comments

  1. Casino | Tricktactoe
    Casino online. Welcome to our 턱시도 사이트 casino portal and experience your favorite games. Sign up and start playing and win! 888 스포츠 · 1xbet 먹튀 Earn Free Spins and  Rating: 4.3 · ‎7,051 벨라가르텐 votes 출장샵

    ReplyDelete

Post a Comment

Popular posts from this blog

Outlook VBA Macros for Journal Entries

SCCM PXE Boot Issues - No Advertisements Found

Updating Dell iDRAC ISM