Skip to content

Instantly share code, notes, and snippets.

@mattmcnabb
Created May 21, 2015 14:43
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 mattmcnabb/2543c40aa657d1a98af3 to your computer and use it in GitHub Desktop.
Save mattmcnabb/2543c40aa657d1a98af3 to your computer and use it in GitHub Desktop.
Adding a Parameter that supports '*'
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