Skip to content

New-UDRadio

SYNOPSIS

Creates a radio.

SYNTAX

New-UDRadio [[-Id] <String>] [[-Label] <String>] [-WithGap] [-Disabled] [[-OnChange] <Object>]
 [[-Group] <String>] [-Checked] [<CommonParameters>]

DESCRIPTION

Creates a radio. Radios can be used to select between a set of items. They should be grouped together.

EXAMPLES

Basic Radio

New-UDRadio -Label 'Option 1' -Group 'Group 1'
New-UDRadio -Label 'Option 2' -Group 'Group 1'
New-UDRadio -Label 'Option 3' -Group 'Group 1'

Creates three options for a radio group.

OnChange

New-UDRadio -Label 'Option 1' -Group 'Group 1' -OnChange { Show-UDToast -Message $EventData }
New-UDRadio -Label 'Option 2' -Group 'Group 1' -OnChange { Show-UDToast -Message $EventData }
New-UDRadio -Label 'Option 3' -Group 'Group 1' -OnChange { Show-UDToast -Message $EventData }

Creates three options for a radio group with onChange event handlers.

Multiple groupos

New-UDRadio -Label 'Option 1' -Group 'Group 1'
New-UDRadio -Label 'Option 2' -Group 'Group 1'
New-UDRadio -Label 'Option 3' -Group 'Group 1'

New-UDRadio -Label 'Option 1' -Group 'Group 2'
New-UDRadio -Label 'Option 2' -Group 'Group 2'
New-UDRadio -Label 'Option 3' -Group 'Group 2'

Creates three options for two radio groups.

PARAMETERS

-Checked

Whether the radio is checked.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Disabled

Whether this radio is disabled.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Group

The group for this radio. Only one option for a group can be selected.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Id

The ID for this radio.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Label

The label for this radio.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OnChange

A script block to invoke when this radio is changed. The event data will be available via the $EventData variable in the script block.

Type: System.Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WithGap

Provides a gap style for the radio button.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

Back to top