MSEndpointMgr / ModernBIOSManagement

MIT License
45 stars 22 forks source link

Update Invoke-CMDownloadBIOSPackage: Script 'bails out' when multiple packages are added to the BIOS package list #4

Open mstraessner opened 3 years ago

mstraessner commented 3 years ago

Troubleshooting: device has some UEFI updates, but none is selected instead of the last update. It's a casting error at selection by all lines with: $PackageList = $PackageList | Sort-Object -Property SourceDate -Descending | Select-Object -First 1

Solution: Create an array object and not a PSCustom object, so that the method count is present.

ddobert commented 3 years ago

nice!

m0nkiwitacaus commented 3 years ago

Writing to confirm this to be working on HP systems. Will verify with Dell's later on, but we have no Microsoft or Lenovo computers in our environment.

JEngel05 commented 3 years ago

Doesn't seem to fix Lenovo. The last few lines of the apply-bios log are: BIOS package list contains multiple matches, attempting to set task sequence variable BIOS detection process failed, please refer to previous error or warning messages.

Powershell transcription logs show it failing on: (Get-BIOSUpdate): "You cannot call a method on a null-valued expression"

m0nkiwitacaus commented 3 years ago

Writing back to confirm that no issues on Dell either. Can't speak to the Lenovo problem JEngel05 was having, and we're not currently using Surfaces.

Stensdal commented 3 years ago

I was also having problems with Lenovo computers, even with this fix. But found the problem in the line that call the Compare-BIOSversion function for Lenovo (line 1193), there is not a value "PackageDescription" it's just "Description". It must be changed together with the changes in this request.

Compare-BIOSVersion -AvailableBIOSVersion $PackageList[0].Version -AvailableBIOSReleaseDate $(($PackageList[0].PackageDescription).Split(":")[2]).Trimend(")") -ComputerManufacturer $ComputerManufacturer

Should be changed to: Compare-BIOSVersion -AvailableBIOSVersion $PackageList[0].Version -AvailableBIOSReleaseDate $(($PackageList[0].Description).Split(":")[2]).Trimend(")") -ComputerManufacturer $ComputerManufacturer