Find the values in ValidateSet

Question:

I was wondering if there was a way to retrieve the values used in the clause Param() for ValidateSet. Something like this would be great:

But of course there is no such property on the Type object. Is it possible to retrieve the values set in ValidateSet?

Answer:


After your comment:

The Get-Variable call also works in a function.

Source:

Find the values in ValidateSet by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply