Skip to content

Instantly share code, notes, and snippets.

@McAndersDK
Created February 1, 2019 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McAndersDK/31bf2c5c5f56f087ee9517b385fb8551 to your computer and use it in GitHub Desktop.
Save McAndersDK/31bf2c5c5f56f087ee9517b385fb8551 to your computer and use it in GitHub Desktop.
$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