There are a plenty of examples online of how to use validateset in a powershell script.
And I do know that [System.ConsoleColor] works using tab complete by default.
But I’m in the middle of a powershell WPF-POC and noticed that [System.ConsoleColor] doesn’t by far include the wide ranges of colors available and it bothered me so…
The following example is only showing how to apply this to [System.Drawing.Brushes] but I bet you could use the same technique to any other .NET type as well.
Hopefully it’ll save someone the time it took for me to google it and pick up the vital parts :)
Comments