Skip to content

Get-LSUpdate error: "An item with the same key has already been added." #76

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
IT360BE opened this issue Mar 14, 2023 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@IT360BE
Copy link

IT360BE commented Mar 14, 2023

Version

1.5.2

Computer Model

20S7S02200

Problem

Get-LSUpdate -Model $model -All -Verbose | Where-Object { $_.Installer.Unattended }

throws this error:
Exception calling "Add" with "2" argument(s): "An item with the same key has already been added."

Additional context

No response

@IT360BE IT360BE added the bug Something isn't working label Mar 14, 2023
@jantari
Copy link
Owner

jantari commented Mar 14, 2023

Yea, I noticed this error yesterday as well. lt is new in 1.5.2 - my bad.

It happens when multiple different packages for one computer have the same name which I didn't think could be the case.

The line that's failing isn't that important though so you should be able to just ignore it for now and I'll fix it in the next release.

Thank you for reporting it!

@jantari jantari changed the title Get-LSUpdate for 20S7S02200 throws error Get-LSUpdate error: "An item with the same key has already been added." Mar 14, 2023
@swoonhusker1
Copy link

My install is running via Powershell App Deployment Toolkit and it looks like it is stuck and never gets the drivers-
image

I wonder if there is something I need to do in order to get it to continue.

When I run it in powershell ISE it does continue-
image

@swoonhusker1
Copy link

Looks like it's doing the same thing in our task sequence. I'm going to switch it back to copying the 1.5.1 version and re-image to make sure it's working again.

@jantari
Copy link
Owner

jantari commented Mar 14, 2023

@swoonhusker1 Are you maybe setting $ErrorActionPreference to Stop in your script? That would make any script exit at the first error. But with the default setting of Continue it should print the error and .... continue 😄

@swoonhusker1
Copy link

I tried setting ErrorActionPreference to continue and it looks like it's still not working, but like I said if I run it in normal powershell it works fine, so I think it has something to do with Powershell App Deployment Toolkit (PSADT) that I don't understand. I'm going to set the script to install the 1.5.1 version for now.

@IT360BE
Copy link
Author

IT360BE commented Mar 15, 2023

I tried setting ErrorActionPreference to continue and it looks like it's still not working, but like I said if I run it in normal powershell it works fine, so I think it has something to do with Powershell App Deployment Toolkit (PSADT) that I don't understand. I'm going to set the script to install the 1.5.1 version for now.

psappdeplykit is running in a big try catch loop... that is your issue.

Add this before you run the powershell script:
image

and this after:
image

@jantari
Copy link
Owner

jantari commented Mar 18, 2023

LSUClient 1.5.3 just released and fixes this. Thanks again for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants