Skip to content

Conversation

@chrrobi
Copy link

@chrrobi chrrobi commented May 22, 2024

Description Of Changes

Updating the Get-RemoteChecksum function to leverage the .NET webclient vs
the Invoke-WebRequest to speed up the process significantly.

Motivation and Context

The current Get_RemoteChecksum implementation uses Invoke-WebRequest
which can be slow on larger files. This results in a long checksumming
process during automated packaging. By switching to the .NET webclient,
while losing the "interactive" download update (ie the ticker across the screen),
we significantly increase the speed of the download. For example, on a 150 mb
file, it went from minutes to download to seconds.

Testing

  1. This was tested locally on a windows 11 system using the ./update.sh and au_beforeupdate()
  2. This was tested within the chocolatey linux docker image using the ./update.sh and au_beforeupdate()

Operating Systems Testing

  • Windows 11 (Powershell 5)
  • chocolatey docker image with pwsh 7

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Issue #58

Fixes #58

chrrobi added 5 commits May 15, 2024 16:07
The current Get_RemoteChecksum implementation uses Invoke-WebRequest
which can be slow on larger files. This results in a long checksumming
process during automated packaging. By switching to the .NET webclient,
while losing the "interactive" download update, we significantly increase
the speed of the download. For example, on a 150 mb file, it went from minutes
to download to seconds.
* 'develop' of github.com:chrrobi/chocolatey-au:
  Change the way the file is downloaded to speed it up
The current Get_RemoteChecksum implementation uses Invoke-WebRequest
which can be slow on larger files. This results in a long checksumming
process during automated packaging. By switching to the .NET webclient,
while losing the "interactive" download update, we significantly increase
the speed of the download. For example, on a 150 mb file, it went from minutes
to download to seconds.

Added modified date in this commit
The current Get_RemoteChecksum implementation uses Invoke-WebRequest
with progress bar which can be slow on larger files. This results in a
long checksumming process during automated packaging. By providing the
option to hide the progress bar, while losing the "interactive" download
update, we significantly increase the speed of the download.
@flcdrg
Copy link
Contributor

flcdrg commented Dec 19, 2025

Looks like you changed the approach to just disable the progress status, rather than use WebClient. Did you want to update the PR title and description and then we can get this merged?

@flcdrg flcdrg added the 0 - Waiting on User Insufficient information for issue or PR, issue may be closed if no response from user. label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 - Waiting on User Insufficient information for issue or PR, issue may be closed if no response from user.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up Get_RemoteCheckSum

2 participants