When there's multiple package detected for HP or Microsoft, it's using this code to sort which one to take:
If ($PackageList -eq $null) {
# Fall back to select the latest model type match if no model name match is found
$PackageList = $PackageList | Sort-object -Property SourceDate -Descending | Select-Object -First 1
}
} elseif ($ComputerManufacturer -match "Hewlett-Packard|HP") {
# Determine the latest BIOS package by creation date
$PackageList = $PackageList | Sort-Object -Property PackageCreated -Descending | Select-Object -First 1
} elseif ($ComputerManufacturer -match "Microsoft") {
$PackageList = $PackageList | Sort-Object -Property PackageCreated -Descending | Select-Object -First 1
Problem is to sort, it's using "PackageCreated" which isn't part of the array. We should use the SourceDate like any other model (why the change?).
Alsso, the comment on the first sort isn't right, it says it's sorting to the latest model type match but in fact, it's sorting to the latest package match (there's a difference).
Hello,
When there's multiple package detected for HP or Microsoft, it's using this code to sort which one to take:
Problem is to sort, it's using "PackageCreated" which isn't part of the array. We should use the SourceDate like any other model (why the change?).
Alsso, the comment on the first sort isn't right, it says it's sorting to the latest model type match but in fact, it's sorting to the latest package match (there's a difference).