Monday, January 9, 2012

Finding Standard Parameter Names in PowerShell

 

PowerTip of the Day, from PowerShell.com:

 

In a previous tip, we suggested you to use standard parameter names for your own functions. To get a feeling for what the parameter names are that built-in cmdlets use, here is some code that creates a list of them:

PS> Get-Command -CommandType Cmdlet | Select-Object -ExpandProperty Parameters |  ForEach-Object { $_.Keys } | Group-Object -NoElement | Sort-Object Count, Name -Descending

(...)

   68 Force

   67 Name

   54 InputObject

   54 Credential

   52 Path

   44 PassThru

(...)

No comments:

Post a Comment