Skip to content

Alternate URL Repositories? #35

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

Closed
arejaytee opened this issue Jul 9, 2021 · 6 comments
Closed

Alternate URL Repositories? #35

arejaytee opened this issue Jul 9, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@arejaytee
Copy link

Seems that the https://download.lenovo.com/ repo is not working currently, is there other known ones?

@arejaytee arejaytee added the enhancement New feature or request label Jul 9, 2021
@jantari
Copy link
Owner

jantari commented Jul 9, 2021

Hello, could you give me the exact error(s) you are getting when trying to access that repository with LSUClient? Because it is working fine here. There are no other official repositories that I am aware of but I have nearly finished the feature for LSUClient to be able to use your own, internal repository instead (#17)

The work on that is being done on the feat-customrepository branch.

@arejaytee
Copy link
Author

Seems I needed to test it with a few more model numbers, and that Australian model numbers are not in the format that is currently expected.

Get-LSUpdate -Model 80VB 404 Error
Get-LSUpdate -Model 81W1 WORKED
Get-LSUpdate -Model 20RW 404 Error
Get-LSUpdate -Model 81VU WORKED

Do not match.
Get-LSUpdate -Model 3238CE1
Get-LSUpdate -Model 10HSA00KAU
Get-LSUpdate -Model 90LX0052AU
Get-LSUpdate -Model 90HU0059AU
Get-LSUpdate -Model 3261E9M
Get-LSUpdate -Model 90BJ00C7AU
Get-LSUpdate -Model 10KQ000BAU
Get-LSUpdate -Model 10M7A005AU
Get-LSUpdate -Model 20FW0005AU
Get-LSUpdate -Model 20S0CTO1WW
Get-LSUpdate -Model 20L5S09W00
Get-LSUpdate -Model 20JTS0HT00
Get-LSUpdate -Model 20QDA01KAU
Get-LSUpdate -Model 20S0CTO1WW
Get-LSUpdate -Model 20Q7A00AAU
Get-LSUpdate -Model 20RA001LAU
Get-LSUpdate -Model 90G9002LAU
Get-LSUpdate -Model 3238B47
Get-LSUpdate -Model 10AXA1BPAU
Get-LSUpdate -Model 20C6A06NAU
Get-LSUpdate -Model F0CU003AAU
Get-LSUpdate -Model 90B600E8AU
Get-LSUpdate -Model 90GB007YAU

@jantari
Copy link
Owner

jantari commented Jul 12, 2021

So the reason all of those longer model numbers did not match is because Get-LSUpdate -Model only takes a 4-character modelnumber. Lenovo also calls this the "Type" of a computer and from what I've seen so far it's always the first 4 characters of the model number.

You can go to the Lenovo Warranty Check website ( https://pcsupport.lenovo.com/en/us/warrantylookup#/ ) and put in any of these model numbers where it asks for a serial number (e.g. 20QDA01KAU) and it will tell you that it's an X1 Carbon 7th Gen and the "Type" is 20QD. 20QD would then be the value that you need: Get-LSUpdate -Model '20QD'.

As for why you got 404 error(s) for 80VB and 20RW I can't say without the full error messages and also -Verbose output. You can add -Verbose to all cmdlets in this module and they'll give you more details on what they're currently doing which helps provide context for errors like that as well. If you were to pass in an invalid or nonexistant model/type you would have gotten this error: "No information was found on this model of computer (invalid model number or not supported by Lenovo?)" and not a 404, so that's not the problem with these.

A 404 could mean a file is just missing on Lenovos' servers (that happens) or you're being blocked from accessing it, possibly by a company firewall on your network etc. Either way, it's not a terminating error so the command should continue after the error and still show you available updates.

@arejaytee
Copy link
Author

Thanks for the extra information, will check the longer ones and if they match will just always shorten it to the first 4 characters. Originally thought it was a firewall blocking but then tried at different locations and same thing!

Verbose output below.
PS C:\Users~> Get-LSUpdate -Model '80VB' -Verbose

VERBOSE: Lenovo Model is: 80VB

VERBOSE: A total of 27 driver packages are available for this computer model.
VERBOSE: Package https://download.lenovo.com/consumer/mobiles/seagatelcm2update_2_.xml doesn't have a DetectInstall section
VERBOSE: Package https://download.lenovo.com/consumer/mobiles/seagate_ldm2_7nov_2_.xml doesn't have a DetectInstall section
MethodInvocationException: C:\Users~\OneDrive - Levit8 PTY LTD\Documents\PowerShell\Modules\LSUClient\1.1.0\public\Get-LSUpdate.ps1:110:21
Line |
110 | … $webClient.DownloadFile(($packageURL.location -replace "[ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."

InvalidOperation: C:\Users~\OneDrive - Levit8 PTY LTD\Documents\PowerShell\Modules\LSUClient\1.1.0\private\Invoke-PackageCommand.ps1:13:5
Line |
13 | $ExeAndArgs.Arguments = Assert-CmdAmpersandEscaped -String $ExeAn …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Arguments' cannot be found on this object. Verify that the property exists and can be set.

Seems 20RW is working better now-
PS C:\Users~> Get-LSUpdate -Model 20RW -Verbose

VERBOSE: Lenovo Model is: 20RW

VERBOSE: A total of 33 driver packages are available for this computer model.
VERBOSE: Package https://download.lenovo.com/pccbbs/mobiles/fhybd22_2_.xml doesn't have a DetectInstall section
VERBOSE: Package https://download.lenovo.com/consumer/mobiles/v340fw01cp/v340fw01cp_2_.xml doesn't have a DetectInstall section
InvalidOperation: C:\Users~\OneDrive - Levit8 PTY LTD\Documents\PowerShell\Modules\LSUClient\1.1.0\private\Invoke-PackageCommand.ps1:13:5
Line |
13 | $ExeAndArgs.Arguments = Assert-CmdAmpersandEscaped -String $ExeAn …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Arguments' cannot be found on this object. Verify that the property exists and can be set.

VERBOSE: Got unsupported version format from OS: '8.6.10402.11528 8.6.10402.11528'
VERBOSE: Unsupported dependency encountered: _WindowsBuildVersion

VERBOSE: Unsupported dependency encountered: _WindowsBuildVersion

VERBOSE: Unsupported dependency encountered: _WindowsBuildVersion

VERBOSE: Unsupported dependency encountered: _OSNLang

VERBOSE: Unsupported dependency encountered: _WindowsBuildVersion

VERBOSE: Package https://download.lenovo.com/pccbbs/mobiles/wldcgt09_2_.xml doesn't have a DetectInstall section

@jantari
Copy link
Owner

jantari commented Jul 12, 2021

Well the first thing I'm noticing is that you're using a very old version of the module (1.1.0).

If you look on the PowerShell Gallery or here on GitHub on the releases page you can see that the current version is 1.2.5. You should regularly update your PowerShell modules, LSUClient included, because not only do the newer versions have bugfixes for known problems and more features but Lenovo also updates their repositories and adds new drivers etc. that sometimes only the newer versions of LSUClient can work with properly - outdated versions can give you incomplete or inaccurate results, particularly during the update search process of Get-LSUpdate.

With that being said, I tried 20RW and 80VB with LSUClient version 1.2.5 and while 20RW completed without any complaints and most errors you saw with 80VB also went away I did still get a single 404 error for the file getw10ver7.exe. I looked into it and that file just doesn't exist on Lenovos' server even though one of their packages references it, so the 404 is warranted, but it's not a problem on your network or in LSUClient and therefore not something I can fix. I don't think there's anything we can do other than wait for Lenovo to maybe notice and fix it on their end. The Get-LSUpdate command should still finish and give you accurate results though, so it's not actually a big problem!

@arejaytee
Copy link
Author

Not sure how that happened and didn't even think to check, was a fresh install of the LSUclient from PSGallery that day I originally posted too!!!

jantari pushed a commit that referenced this issue Jul 28, 2023
this makes no difference when running Get-LSUpdate in a normal
PowerShell session, but some deployment/script-running solutions wrap
the entire script in a big try-catch which triggered on any .NET
exception from DownloadFile. Try-Catching the DownloadFile call
separately and "downgrading" any exceptions to a PowerShell-native
error prevents any unintended script terminations in such cases.

I still recommend NOT wrapping LSUClient scripts in a global try-catch
whenever it is possible to avoid it.

also referencing previous issues #35, #36, #37 and #65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants