Closed swoonhusker1 closed 1 year ago
I think, the leading zeros in the DetectInstall._Firmware.Version
elements are causing this. From lines 6181 and 6182:
[ Got: 102000A, Expected: 0102000a^ ]
Something unsupported encountered in: _Firmware
Test:
"102000A" -eq "0102000a^".Trim("^")
False
"0102000A" -eq "0102000a^".Trim("^")
True
The easiest solution would be to change this line in Test-MachineSatisfiesDependency
if ($PnpDeviceFirmwareRev -eq $LenovoVersion.Trim('^')) {
to
if ($PnpDeviceFirmwareRev -eq $LenovoVersion.Trim('^').TrimStart("0")) {
Or for later tests, with hexadecimal comparisons and taking the circumflex into consideration:
if ($LenovoVersion.EndsWith("^")) {
# greater equals
if ([int] ("0x{0}" -f $PnpDeviceFirmwareRev) -ge [int] ("0x{0}" -f $LenovoVersion.Trim("^").TrimStart("0"))) {
}
else {
if ([int] ("0x{0}" -f $PnpDeviceFirmwareRev) -eq [int] ("0x{0}" -f $LenovoVersion.Trim("^").TrimStart("0"))) {
}
Thanks for reporting this. @animentork is right, this is caused by the same underlying issue (lack of complete support for _Firmware tests and hexadecimal version comparisons) that also causes #61.
I have just pushed a5a2047 which should completely fix this now. If one of you has a 20Y0 or 20UC handy and wants to test the latest develop branch version then please go ahead and report back.
Thanks for that, I wanted to test and maybe I'm doing something wrong but I'm getting some errors. Does this make any sense to you?
PS C:\WINDOWS\system32> Import-Module -Name C:\Temp\developermodule12-13\LSUClient-develop\LSUClient.psm1 -Verbose VERBOSE: Loading module from path 'C:\Temp\developermodule12-13\LSUClient-develop\LSUClient.psm1'. VERBOSE: Exporting function 'Compare-Array'. VERBOSE: Exporting function 'Compare-Version'. VERBOSE: Exporting function 'Debug-LongRunningProcess'. VERBOSE: Exporting function 'Expand-LSUpdate'. VERBOSE: Exporting function 'Get-PackagePathInfo'. VERBOSE: Exporting function 'Get-PackagesInRepository'. VERBOSE: Exporting function 'Get-WindowsVersion'. VERBOSE: Exporting function 'Install-BiosUpdate'. VERBOSE: Exporting function 'Invoke-PackageCommand'. VERBOSE: Exporting function 'New-WebClient'. VERBOSE: Exporting function 'Remove-CmdEscapeCharacter'. VERBOSE: Exporting function 'Resolve-CmdVariable'. VERBOSE: Exporting function 'Resolve-XMLDependencies'. VERBOSE: Exporting function 'Save-PackageFile'. VERBOSE: Exporting function 'Set-BIOSUpdateRegistryFlag'. VERBOSE: Exporting function 'Show-DownloadProgress'. VERBOSE: Exporting function 'Split-ExecutableAndArguments'. VERBOSE: Exporting function 'Test-MachineSatisfiesDependency'. VERBOSE: Exporting function 'Test-RunningAsAdmin'. VERBOSE: Exporting function 'Test-VersionPattern'. VERBOSE: Exporting function 'Test-Wflash2ForSCCMParameter'. VERBOSE: Exporting function 'Get-LSUClientConfiguration'. VERBOSE: Exporting function 'Get-LSUpdate'. VERBOSE: Exporting function 'Install-LSUpdate'. VERBOSE: Exporting function 'Save-LSUpdate'. VERBOSE: Exporting function 'Set-LSUClientConfiguration'. VERBOSE: Importing function 'Compare-Array'. VERBOSE: Importing function 'Compare-Version'. VERBOSE: Importing function 'Debug-LongRunningProcess'. VERBOSE: Importing function 'Expand-LSUpdate'. VERBOSE: Importing function 'Get-LSUClientConfiguration'. VERBOSE: Importing function 'Get-LSUpdate'. VERBOSE: Importing function 'Get-PackagePathInfo'. VERBOSE: Importing function 'Get-PackagesInRepository'. VERBOSE: Importing function 'Get-WindowsVersion'. VERBOSE: Importing function 'Install-BiosUpdate'. VERBOSE: Importing function 'Install-LSUpdate'. VERBOSE: Importing function 'Invoke-PackageCommand'. VERBOSE: Importing function 'New-WebClient'. VERBOSE: Importing function 'Remove-CmdEscapeCharacter'. VERBOSE: Importing function 'Resolve-CmdVariable'. VERBOSE: Importing function 'Resolve-XMLDependencies'. VERBOSE: Importing function 'Save-LSUpdate'. VERBOSE: Importing function 'Save-PackageFile'. VERBOSE: Importing function 'Set-BIOSUpdateRegistryFlag'. VERBOSE: Importing function 'Set-LSUClientConfiguration'. VERBOSE: Importing function 'Show-DownloadProgress'. VERBOSE: Importing function 'Split-ExecutableAndArguments'. VERBOSE: Importing function 'Test-MachineSatisfiesDependency'. VERBOSE: Importing function 'Test-RunningAsAdmin'. VERBOSE: Importing function 'Test-VersionPattern'. VERBOSE: Importing function 'Test-Wflash2ForSCCMParameter'.
PS C:\WINDOWS\system32> Import-Module -Name C:\Temp\developermodule12-13\LSUClient-develop\LSUClient.psd1 -Verbose VERBOSE: Loading module from path 'C:\Temp\developermodule12-13\LSUClient-develop\LSUClient.psd1'. VERBOSE: Importing function 'Compare-Array'. VERBOSE: Importing function 'Compare-Version'. VERBOSE: Importing function 'Debug-LongRunningProcess'. VERBOSE: Importing function 'Expand-LSUpdate'. VERBOSE: Importing function 'Get-LSUClientConfiguration'. VERBOSE: Importing function 'Get-LSUpdate'. VERBOSE: Importing function 'Get-PackagePathInfo'. VERBOSE: Importing function 'Get-PackagesInRepository'. VERBOSE: Importing function 'Get-WindowsVersion'. VERBOSE: Importing function 'Install-BiosUpdate'. VERBOSE: Importing function 'Install-LSUpdate'. VERBOSE: Importing function 'Invoke-PackageCommand'. VERBOSE: Importing function 'New-WebClient'. VERBOSE: Importing function 'Remove-CmdEscapeCharacter'. VERBOSE: Importing function 'Resolve-CmdVariable'. VERBOSE: Importing function 'Resolve-XMLDependencies'. VERBOSE: Importing function 'Save-LSUpdate'. VERBOSE: Importing function 'Save-PackageFile'. VERBOSE: Importing function 'Set-BIOSUpdateRegistryFlag'. VERBOSE: Importing function 'Set-LSUClientConfiguration'. VERBOSE: Importing function 'Show-DownloadProgress'. VERBOSE: Importing function 'Split-ExecutableAndArguments'. VERBOSE: Importing function 'Test-MachineSatisfiesDependency'. VERBOSE: Importing function 'Test-RunningAsAdmin'. VERBOSE: Importing function 'Test-VersionPattern'. VERBOSE: Importing function 'Test-Wflash2ForSCCMParameter'.
PS C:\WINDOWS\system32> Get-LSUpdate | Where-Object { $.Installer.Unattended -and $.Title -notlike "Intel Graphics Driver"} -Verbose Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:217 char:13
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:221 char:21
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:221 char:21
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot create object of type "LenovoPackage". Cannot convert the "System.Collections.Generic.List1[PackageFilePointer]" value of type "System.Collections.Generic.List
1[[PackageFilePointer, ⧹C։⧹Program Files⧹WindowsPowerShell⧹Modules⧹LSUClient⧹1.5.0⧹LSUClient.psm1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"
to type "PackageFilePointer".
At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:297 char:102
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : ObjectCreationError
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:217 char:13
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:221 char:21
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:221 char:21
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:221 char:21
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:221 char:21
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
WARNING: The command or file '%PACKAGEPATH%\usbcdkfw3704_1_version.exe /HWID=3060 /APPNAME=usbcdkfw3704_1_detect' could not be found from 'C:\Users\DoughertyP\AppData\Local\Temp\howuc32z.i01\
w5foljtq.5l4' and was not run
Cannot create object of type "LenovoPackage". Cannot convert the "System.Collections.Generic.List1[PackageFilePointer]" value of type "System.Collections.Generic.List
1[[PackageFilePointer, ⧹C։⧹Program Files⧹WindowsPowerShell⧹Modules⧹LSUClient⧹1.5.0⧹LSUClient.psm1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"
to type "PackageFilePointer".
At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:297 char:102
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : ObjectCreationError
Cannot find an overload for "Add" and the argument count: "1". At C:\Temp\developermodule12-13\LSUClient-develop\public\Get-LSUpdate.ps1:217 char:13
I don't know why I'm getting so many errors when trying to do get-lsuupdate.
That is a long-standing issue in PowerShell but you should just be able to open a new PowerShell window and import the develop module right away (it's important to do it before importing or using the regular version or you'll get the errors above)
Thank you! That looks like it worked and the Lenovo Battery Firmware Update Utility is no longer returned-
Looking forward to this fix int he next release! Is there a way I can see when the next Lsuclient release will be?
Just checking in to find out how I can see when updates to the client are scheduled to be released? I'm planning to do some pilot testing and eventually roll this out to laptops in our company.
There is no regular release schedule or anything like that. When bugfixes or features are done I test them for a while and release when I'm pretty sure the changes won't break anything. Because the module has so many downloads now and because of the wide wide variety of hardware and driver packages a change can often affect the results in a different environment too.
I take some time to compare 1.5.0 vs develop results on as many different models as I have access to and look for regressions. If I don't find any then 1.5.1 should be out next week.
Published Version 1.5.1 which includes this fix
Thank you very much jantari!!!
Version
1.5.0 and lsuclient-develop
Computer Model
20Y0
Problem
Trying to run the LSUclient 1.5.0 and the LSUclient-develop and both are showing that "Lenovo Battery Firmware Update Utility" is needed but it does not ever install. The exit code is -3. The battery firmware is up to date on that one according to the wudetect.exe but detection is off I think.
In the additional context field I put a text file of the output of the get-lsuupdate -verbose -debug to see if that helps. That is using the lsuclient-develop module.
Additional context
get-lsuupdate -verbose -debug.txt