Creating multiple dropdowns

I’ve been trying to generate some drop down menu (comboboxes) based on the information i found on this link: Custom Select Input using ValidateSet with Array

For testing purposes it works nice, but i have one bigg problem, when i use our production AD groups, they all contain a dash “-” and by using the above method they are filtered out, and the selected variable is having a wrong group name. I tried a lot of things, but it seems i can’t get it working with our actual group names. Any suggestions how i could get this fixed?

A second point about drop downs, is there a way to populate a dropdown menu based on the selection of the first one?

Let’s say you select Option A in a drop down, then the second dropdown should display Option X and Option Z, but when selection Option B in the first one, it should shouw option Q and option O in the second one.

When i run my page it seems it always expects to know the value of the second dropdown menu before loading the page and returns:

New-UDDashboard : Exception calling “Invoke” with “0” argument(s): "Exception calling “Invoke” with “0” argument(s)

When i use a validateset with constants, it loads perfectly.