I use dynamic validate sets for my functions for mandatory parameters.
When not provided Powershell prompts and forces user to input.
However in this case, T
You can only use tab on ValidateSet You can see same behavior if you use Show-Command The only pre run validation is ValidateSet
try this:
Function Test-Function
{
Param
(
[String]$NormalParameter,
[ValidateSet('T1','T2','T3')]
[String]$ValidateSetParameter,
[ValidatePattern("[T4]|[T5]|[T6]")]
[String]$ValidatePatternParameter,
[ValidateScript({$_ -In ('T7','T8','T9')})]
[String]$ValidateScriptParameter,
[ValidateRange('A','C')]
[String]$ValidateRangeParameter
)
}
Show-Command Test-Function