Created
May 21, 2015 14:43
-
-
Save mattmcnabb/2543c40aa657d1a98af3 to your computer and use it in GitHub Desktop.
Adding a Parameter that supports '*'
This file contains 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
function Test-Star | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[ValidateSet('Option1','Option2','Option3','*')] | |
[ValidateScript({ ($_ -contains '*' -and $_ -isnot [array]) -or ($_ -notcontains '*') })] | |
$StarParam | |
) | |
$StarParam | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment