I have a hash table with keys as Guids and values as string. Of which some of the values are same with different Guids. User will be presented with an prompt which contains a droplist of options and the selected option from the droplist will be selected as an input for next step. In order to achieve this, I'm trying to display values in the drop down list but I'm getting Guids/keys instead. Is there a way to display values which are strings(and have duplicates) instead of Guids?
$options = [Ordered]@{}
Foreach ($i in $Items) // $Items contains list of items
{
$options +=@{i.Id = $i.DisplayName}
}
$options.keys is displaying all the guids $options.values is displaying the names. However when I try to display them to allow users to select an input, I'm getting Guids in the drop-down list
$props = @{
Parameters = @(
@{
Name = "Name"; Title = "Name"; Options = $options
}
)
}
Displaying in the dialog Using:
$name =Read-Variable @props