Closed jhall12 closed 5 years ago
Error message with current code
Select-Object : The property cannot be processed because the property "Operability" already exists. At ..\As-Built-Report-dev\Src\Public\Reports\UCS\UCS.ps1:110 char:81
+ CategoryInfo : InvalidOperation: (Cisco.Ucsm.ComputeBlade:PSObject) [Select-Object], PSArgumentException + FullyQualifiedErrorId : AlreadyExistingUserSpecifiedPropertyNoExpand,Microsoft.PowerShell.Commands.SelectObjectCommand
Current Code Operability is defined twice in the code
$UcsBlade = Get-UcsBlade if ($UcsBlade) { Section -Style Heading3 -Name 'Blade Server Inventory' { $UcsBlade = $UcsBlade | Sort-Object ChassisID, SlotID | Select-Object @{L = 'Server Id'; E = {$_.ServerId}}, Model, @{L = 'Available Memory'; E = {$_.AvailableMemory}}, @{L = 'Number of CPUs'; E = {$_.NumOfCpus}}, @{L = 'Number of Cores'; E = {$_.NumOfCores}}, @{L = 'Number of Adapters'; E = {$_.NumOfAdaptors}}, @{L = 'Number of Ethernet Interfaces'; E = {$_.NumOfEthHostIfs}}, @{L = 'Number of FC Host Interfaces'; E = {$_.NumOfFcHostIfs}}, @{L = 'Assigned To'; E = {$_.AssignedToDn}}, Presence, @{L = 'Operability'; E = {$_.OperState}}, Operability, @{L = 'Power'; E = {$_.OperPower}}, Serial $UcsBlade | Table -Name 'Server Inventory' } }
New Code Operability second instance is removed removing the error message without impacting the script function
$UcsBlade = Get-UcsBlade if ($UcsBlade) { Section -Style Heading3 -Name 'Blade Server Inventory' { $UcsBlade = $UcsBlade | Sort-Object ChassisID, SlotID | Select-Object @{L = 'Server Id'; E = {$_.ServerId}}, Model, @{L = 'Available Memory'; E = {$_.AvailableMemory}}, @{L = 'Number of CPUs'; E = {$_.NumOfCpus}}, @{L = 'Number of Cores'; E = {$_.NumOfCores}}, @{L = 'Number of Adapters'; E = {$_.NumOfAdaptors}}, @{L = 'Number of Ethernet Interfaces'; E = {$_.NumOfEthHostIfs}}, @{L = 'Number of FC Host Interfaces'; E = {$_.NumOfFcHostIfs}}, @{L = 'Assigned To'; E = {$_.AssignedToDn}}, Presence, @{L = 'Operability'; E = {$_.OperState}}, @{L = 'Power'; E = {$_.OperPower}}, Serial $UcsBlade | Table -Name 'Server Inventory' } }
A new Cisco UCS Manager report is currently in development which addresses this issue.
Error message with current code
Select-Object : The property cannot be processed because the property "Operability" already exists. At ..\As-Built-Report-dev\Src\Public\Reports\UCS\UCS.ps1:110 char:81
Current Code Operability is defined twice in the code
New Code Operability second instance is removed removing the error message without impacting the script function