Console icon indicating copy to clipboard operation
Console copied to clipboard

Show-ListView logs error about duplicate Name

Open michaellwest opened this issue 3 years ago • 1 comments

Error message:

ManagedPoolThread #1 09:31:09 WARN The property cannot be processed because the property "Name" already exists.At line:1 char:26
+ $ScPsSlvPipelineObject | Select-Object -Property $ScPsSlvProperties
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exception: System.Management.Automation.PSArgumentException
Message: The property cannot be processed because the property "Name" already exists.

michaellwest avatar Sep 21 '22 14:09 michaellwest

Tested with these samples:

Get-ChildItem -Path "master:\content\home" | Show-ListView -Property Name
Get-ChildItem -Path "master:\content\home" | Show-ListView
$results = @(
    [pscustomobject]@{
        "Name" = "Michael"
    }
)
$results | Show-ListView -Property Name
$results = @(
    [pscustomobject]@{
        "Name" = "Michael"
    }
)
$results | Show-ListView -Property @{Label="Name"; Expression={$_.Name}}

michaellwest avatar Sep 21 '22 14:09 michaellwest