PowerShell Universal
DownloadsIssuesDiscordForums
v1
v1
  • About
  • Get Started
    • Additional Resources
    • Installation
      • Docker
      • Upgrading
    • Licensing
    • System Requirements
    • Supported Browsers
    • Visual Studio Code Extension
  • Cmdlet Help
  • Examples
    • Active Directory
    • Hyper-V
    • Image Processing
    • Monitoring
    • PowerShell Protect
    • Slack
    • SQL
  • API
    • About
    • Development
    • Endpoints
    • Security
    • Error Handling
    • Rate Limiting
  • Automation
    • About
    • Development
    • Scripts
      • Parameters
    • Jobs
    • Schedules
    • Triggers
    • Variables
  • Dashboard
    • About
    • Development
    • Dashboards
      • Migrating From Universal Dashboard 2.9
      • Building Dashboards
      • Custom Variable Scopes
    • Frameworks
    • Components
      • Pages
      • Dynamic Regions
      • Element
      • Error Boundary
      • HTML
      • Building Custom Components
      • Data Display
        • Alert
        • Chip
        • Date and Time
        • Icon
        • List
        • Table
        • Tree View
        • Typography
      • Data Visualization
        • Charts
        • Map
      • Feedback
        • Backdrop
        • Modal
        • Progress
        • Skeleton
      • Inputs
        • Autocomplete
        • Button
        • Checkbox
        • Code Editor
        • Date Picker
        • Floating Action Button
        • Form
        • Radio
        • Select
        • Slider
        • Switch
        • Textbox
        • Time Picker
        • Upload
      • Navigation
        • Drawer
        • Stepper
        • Tabs
      • Layout
        • Grid Layout
        • Grid
        • Hidden
      • Utilities
        • Transitions
      • Surfaces
        • AppBar
        • Card
        • Paper
        • Expansion Panel
    • Interaction
    • Published Folders
    • Themes
      • Cascading Style Sheets
      • Styles
    • Scheduled Endpoints
    • Role Based Access
    • Marketplace
  • Platform
    • Cache
    • Monitoring
  • Configuration
    • About
    • API
    • Environments
    • Hosting
      • IIS
      • Single-File
    • Login Page
    • Management API
    • Settings
    • Security
      • App Tokens
      • OpenID Connect
      • WS-Federation
    • Running as a Service Account
    • Git
  • Debugging
    • Logging
    • Debugging Scripts
  • Changelog
  • Extension Changelog
  • Legacy Universal Dashboard Docs
Powered by GitBook

PowerShell Universal

  • Downloads
  • Pricing
  • Gallery

Community

  • Issues
  • Forums
  • Discord

Support

  • Portal
  • Knowledgebase

Copyright 2025 Ironman Software

On this page
  • Simple Select
  • Grouped Select
  • OnChange
  • Get-UDElement

Was this helpful?

Edit on Git
Export as PDF
  1. Dashboard
  2. Components
  3. Inputs

Select

Select component for Universal Dashboard

PreviousRadioNextSlider

Last updated 4 years ago

Was this helpful?

Select components are used for collecting user provided information from a list of options.

Simple Select

Create a simple select with multiple options.

New-UDSelect -Option {
    New-UDSelectOption -Name 'One' -Value 1
    New-UDSelectOption -Name 'Two' -Value 2
    New-UDSelectOption -Name 'Three' -Value 3
}

Grouped Select

Create a select with groups of selections.

New-UDSelect -Option {
    New-UDSelectGroup -Name 'Group One' -Option {
        New-UDSelectOption -Name 'One' -Value 1
        New-UDSelectOption -Name 'Two' -Value 2
        New-UDSelectOption -Name 'Three' -Value 3
    }
    New-UDSelectGroup -Name 'Group Two' -Option {
        New-UDSelectOption -Name 'Four' -Value 4
        New-UDSelectOption -Name 'Five' -Value 5
        New-UDSelectOption -Name 'Size' -Value 6
    }
}

OnChange

Execute a PowerShell event handler when the value of the select is changed.

New-UDSelect -Option {
    New-UDSelectOption -Name 'One' -Value 1
    New-UDSelectOption -Name 'Two' -Value 2
    New-UDSelectOption -Name 'Three' -Value 3
} -OnChange { Show-UDToast -Message $EventData }

Get-UDElement

Retrieve the value of the select from another component.

  New-UDSelect -Option {
      New-UDSelectOption -Name 'One' -Value 1
      New-UDSelectOption -Name 'Two' -Value 2
      New-UDSelectOption -Name 'Three' -Value 3
  } -Id 'select' -DefaultValue 2

  New-UDButton  -Text 'OnBoard' -OnClick {
    $Element = Get-UDElement -Id 'select'
    if ($Element.Value)
    {
      Show-UDToast -Message $Element.Value
    }
    else 
    {
      Show-UDToast -Message $Element.DefaultValue
    }
  }

New-UDSelect

Name

Type

Description

Required

Id

String

The ID of the component. It defaults to a random GUID.

false

Option

ScriptBlock

Options to include in this select. This can be either New-UDSelectOption or New-UDSelectGroup.

false

Label

String

The label to show with the select.

false

OnChange

Endpoint

A script block that is executed when the script changes. $EventData will be an array of the selected values.

false

DefaultValue

String

The default selected value.

false

Disabled

SwitchParameter

Whether this select is disabled.

false

Multiple

SwitchParameter

Whether you can select multiple values.

false