Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable ValidateSet #61

Open
dwestness opened this issue Aug 2, 2021 · 1 comment
Open

Variable ValidateSet #61

dwestness opened this issue Aug 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@dwestness
Copy link

dwestness commented Aug 2, 2021

I would like to have a drop-down field that lists available values from a variable dataset

E.g. "Please Select an Active Directory Users:"

  • Drop-down list that shows all Active Directory Users (Derived from a "Get-ADUser" output)

I thought perhaps i could use the on-load script to run my Get-ADUser command and store the options in an array variable that could be passed to the actual script, but that doesn't work in any way.

The only thing i can think of at this point is to have the on-load script actually Edit/Modify the script itself to replace the validateset with my requirements, but that seems unrulely.

When i attempt something like this, the option is just presented as "$Users" (explicit string). Is there a way to Expand this into an actual list of User names?

[Parameter(Mandatory, HelpMessage='Select A User:')]
[ValidateSet($Users)]
[string]$User
@markdomansky markdomansky added the enhancement New feature or request label Aug 4, 2021
@markdomansky
Copy link
Owner

Dynamic parameters are not currently possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants