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

Possible issue in Save-KbUpdate with array of URLs instead of scalar string #218

Open
codaamok opened this issue Apr 22, 2023 · 0 comments

Comments

@codaamok
Copy link
Contributor

Hey, I have a question regarding this line:

https://github.com/potatoqualitee/kbupdate/blob/main/public/Save-KbUpdate.ps1#L260

Do you think it should be $hyperlinklol = $dl.Link instead of what it is now? I haven't actually seen this happen, but from reading the code, if $hyperlinklol were an array, then Start-BitsTransfer could download from multiple URLs but to the same -Destination $file.

Start-BitsTransfer accepts an array for -Source so it's likely this could happen, whereas Invoke-WebRequest only accepts scalar string for -Uri.

I would change it but I guess the question is, have you ever seen a single update have multiple download URLs? If no, then we could probably change it. If you have, then we may want to rethink how it downloads.

As an aside, I have a PR incoming to solve a bug in this function where if Start-BitsTransfer throws an error - and then retries with Invoke-TlsWebrequest - then an output FileInfo (from Get-ChildItem) is not returned. It downloads fine, there just isn't any handling to then return an output. This causes an error to bubble up to here (as $updateFile is null) about -Path being null:

https://github.com/potatoqualitee/kbupdate/blob/main/private/Start-DscUpdate.ps1#L288

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

1 participant