Created
July 17, 2018 17:26
-
-
Save h3nryza/57eec693f24c475ca9249b191c9aea32 to your computer and use it in GitHub Desktop.
Powershell Params example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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