Created
February 1, 2019 10:56
-
-
Save McAndersDK/31bf2c5c5f56f087ee9517b385fb8551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Cache:groupNames = Get-ADOrganizationalUnit -LDAPFilter '(name=*)' -SearchBase 'OU=OU1,OU=Groups,DC=domain,DC=domain,DC=local' -SearchScope OneLevel | Select-Object -ExpandProperty name | |
Add-Type -TypeDefinition @" | |
// very simple enum type | |
public enum Departments | |
{ | |
`n $(foreach ($Group in ($Cache:groupNames)){"`t$($Group.replace(" ","_"))`,"} | |
) `n | |
} | |
"@ | |
New-UDCard -Title "Select Dept From Drop Down." -Content { | |
New-UDInput -Title "Departments" -Endpoint{ | |
param ([Departments]$Department) | |
New-UDInputAction -Toast "You selected: $Department" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment