Skip to content

Support dynamically defined ChoiceLabelProperty #127

@jdhitsolutions

Description

@jdhitsolutions

When using Read-SpectreSelection or Read-SpectreMultiSelection, the ChoiceLabelProperty must be unique.

Image

It would be very helpful to dynamically define the label property with a script block.

Read-SpectreMultiSelection -AllowEmpty -Choices (ps pwsh) -ChoiceLabelProperty {"$($_.name) [$($_.id) - $($_.StartTime)]"}

The user could try something like this:

$p = ps pwsh | select *,@{N="Proc";E={ "$($_.name) $($_.id) - $($_.StartTime)" }},
Read-SpectreMultiSelection -AllowEmpty -Choices $p -ChoiceLabelProperty proc

But this feels more cumbersome, and technically this writes a selected object and not the original native objec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions