HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link

Update-OVServerFirmware $Server.romVersion.Split #642

Open CermakPOI opened 1 year ago

CermakPOI commented 1 year ago

In this function there is no variable $Server - The variable $Inputobject should be used. I edited the psm1 file and now it works as expected.

Change Line 47981 from $_ServerBaseID = $Server.romVersion.Split(" ")[0] to $_ServerBaseID = $Inputobject.romVersion.Split(" ")[0]

Expected Behavior

Update Firmware

Actual Behavior

An error is thrown:

C:\Program Files\WindowsPowerShell\Modules\HPEOneView.830\8.30.3534.1611\HPEOneView.830.psm1: line 47981 System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.

Steps to reproduce

Try to start a Formware Update via Update-OVServerFirmware on any server

# 1. Capture verbose output using the Get-HPOVCommandTrace for HPOneView.310 or newer, or append the -Verbose switch to your Cmdlet call.
# 2. Put your code and/or captured output here.
# 3. Remove this comment block before submitting.

Version Information

HPE OneView PowerShell Library Version (Get-HPOVVersion or $PSLibraryVersion): HPE OneView Appliance Version (Get-HPOVVersion -ApplianceVer):
Output from $PSVersionTable on your Windows Host:

# Output from $PSVersionTable
ChrisLynchHPE commented 11 months ago

Thanks for catching this.