Open SeeminglyScience opened 6 years ago
New-UDDoughnutChartDataset -DataProperty 'this' -Label 'that' # Unable to index into an object of type System.Management.Automation.PSObject. # At C:\path\to\Modules\UniversalDashboard\1.4.2\UniversalDashboardServer.psm1:1302 # char:4 # + $obj[$propertyName] = $parameter.Value # + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # + CategoryInfo : InvalidOperation: (:) [], RuntimeException # + FullyQualifiedErrorId : CannotIndex # Unable to index into an object of type System.Management.Automation.PSObject. # At C:\path\to\Modules\UniversalDashboard\1.4.2\UniversalDashboardServer.psm1:1302 # char:4 # + $obj[$propertyName] = $parameter.Value # + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # + CategoryInfo : InvalidOperation: (:) [], RuntimeException # + FullyQualifiedErrorId : CannotIndex # data # ---- # {}
$obj[$propertyName] needs to be $obj.$propertyName or $obj.psobject.Properties[$propertyName].
$obj[$propertyName]
$obj.$propertyName
$obj.psobject.Properties[$propertyName]
Same here
Repro steps
$obj[$propertyName]
needs to be$obj.$propertyName
or$obj.psobject.Properties[$propertyName]
.