Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple package sorting doesn't work #3

Open
nodiaque opened this issue Feb 3, 2021 · 1 comment
Open

multiple package sorting doesn't work #3

nodiaque opened this issue Feb 3, 2021 · 1 comment

Comments

@nodiaque
Copy link

nodiaque commented Feb 3, 2021

Hello,

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).

@Ginolard
Copy link

See my post about the same issue. I have found the issue and it's an easy fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants