Welcome › Forums › General PowerShell Q&A › Dynamic ValidateSet
This topic contains 1 reply, has 2 voices, and was last updated by
I've created an advanced function which has a few parameters that required the ValidateSet to be dynamically populated.
Is there a way to auto populate the set from another cmdlet?
Kind of. What you're looking for is a Dynamic Parameter. Check out https://blogs.technet.microsoft.com/pstips/2014/06/09/dynamic-validateset-in-a-dynamic-parameter/. Alternately, you could write a ValidateScript instead, but that's not going to provide tab completion for permitted values.
The topic ‘Dynamic ValidateSet’ is closed to new replies.