AsBuiltReport / AsBuiltReport.Cisco.UcsManager

Repository for AsBuiltReport Cisco UCS Manager module
https://www.asbuiltreport.com
MIT License
7 stars 4 forks source link

Error: New-AsBuiltReport : Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'. #12

Open tmack8080 opened 3 years ago

tmack8080 commented 3 years ago

Describe the bug UCSM 4.1 Windows PowerShell 5.1 AsBuiltReport.Cisco.UcsManager 2.1

While the report is being generated I receive the following error and the report is not written to disk: New-AsBuiltReport : Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'. At line:1 char:1

To Reproduce New-AsBuiltReport -Report Cisco.UcsManager -Target 'x.x.x.x' -Format Html -OutputFolderPath 'C:\Users\someUser\myApps\AsBuilt\UCS' -Timestamp -Verbose

Expected behavior I am able to successfully run this against 6248 FIs but not against 6332 FIs. I tested in two separate environments for both FI models.

Screenshots VERBOSE: [ 18:59:26:260 ] [ Document ] - Processing section 'Server Pool Assignments' started. VERBOSE: [ 18:59:26:266 ] [ Document ] - Processing section 'Server Pool Assignments' completed. VERBOSE: [ 18:59:26:270 ] [ Document ] - Processing section 'Pools' completed. VERBOSE: [ 18:59:26:279 ] [ Document ] - Processing section 'Servers' completed. VERBOSE: [ 18:59:26:283 ] [ Document ] - Processing section 'LAN' started. VERBOSE: [ 18:59:26:288 ] [ Document ] - Processing section 'LAN Cloud' started. VERBOSE: [ 18:59:26:463 ] [ Document ] - Processing table 'LAN Cloud'. VERBOSE: [ 18:59:26:641 ] [ Document ] - Processing section 'Port Channels and Uplinks' started. VERBOSE: [ 18:59:26:655 ] [ Document ] - Processing table 'Port Channels and Uplinks'. VERBOSE: [ 18:59:26:678 ] [ Document ] - Processing blank line. New-AsBuiltReport : Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'. At line:1 char:1

ThatWindowsGuy commented 3 years ago

I ran into the same issue, but was able to resolve it by modifying line 1488 in Invoke-AsBuiltReport.Cisco.UcsManager.ps1 (C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Cisco.UcsManager\0.2.1\Src\Public)

$UplinkPortChannelMembers += $UplinkPortChannelMember

to

$UplinkPortChannelMembers = $UplinkPortChannelMember

This issue was on UCS Manager 4.1, but worked fine on version 3.1 - 4.0. After making the change, the reports now worked for 4.1, and also worked on the 3.1 - 4.0 versions. Not sure if it contributed to the issue, but the 4.1 UCS Manager only had one port in the port channel.