Skip to content

Instantly share code, notes, and snippets.

@shaneis
Last active October 3, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/cdb1936572b1446ca39e70d093c67213 to your computer and use it in GitHub Desktop.
Save shaneis/cdb1936572b1446ca39e70d093c67213 to your computer and use it in GitHub Desktop.
How to set parameter aliases
<#
function name
comment based help
etc
etc
#>
param(
[parameter(position = 1,
parametersetname = 'id')]
[string]$Identity,
[parameter(position = 1,
parametersetname = 'filter')]
[Alias('l')] # <-- LDAPFilter? Just type 'l'
[string]$LDAPFilter,
[parameter(position = 2)]
[Alias('p')]
[string[]]$Properties, # <-- Properties? Nah, type 'p'
[validateset('list','table')]
[Alias('f')]
[string]$Format = 'list' # <-- Format? Pfft! Try 'f'
)
<#
The rest of the code
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment