Skip to content

Instantly share code, notes, and snippets.

@h3nryza
Created July 17, 2018 17:26
Show Gist options
  • Save h3nryza/57eec693f24c475ca9249b191c9aea32 to your computer and use it in GitHub Desktop.
Save h3nryza/57eec693f24c475ca9249b191c9aea32 to your computer and use it in GitHub Desktop.
Powershell Params example
Param([
parameter(
Mandatory=$true,
Position=0,
ValueFromPipelineByPropertyName=$true,
ValueFromPipeline=$true,
HelpMessage="Enter one or more User names separated by commas.")
]
[ValidateNotNullOrEmpty()]
[alias("UN","User")]
[String[]]
$UserName,
[parameter(
Mandatory=$true,
Position=1,
ValueFromPipelineByPropertyName=$true,
ValueFromPipeline=$true,
HelpMessage="Enter one or more Computer names separated by commas.")
]
[ValidateNotNullOrEmpty()]
[alias("CN","Computer")]
[String[]]
$ComputerName
[switch]$DebugValue
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment