choco icon indicating copy to clipboard operation
choco copied to clipboard

(#3462) Use Get-FileHash cmdlet where possible

Open flcdrg opened this issue 1 year ago • 4 comments

Description Of Changes

Allow use of the Get-FileHash cmdlet when running with versions of PowerShell that include it

Motivation and Context

Thsi should resolve the issue of checksums being unable to be verified for files greater than 2GB. It should also be faster.

Testing

Tested in Vagrant

Operating Systems Testing

Change Types Made

  • [x] 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?
  • [x] PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Fixes chocolatey/checksum#23

flcdrg avatar Jun 10 '24 04:06 flcdrg

Was Get-FileHash available in PowerShell version 3.0?

pauby avatar Jun 10 '24 13:06 pauby

I'm assuming not, as it isn't listed in the 3.0 docs, but is for 4.0

flcdrg avatar Jun 10 '24 13:06 flcdrg

As we still support PowerShell version 3.0, ~~this isn't something I feel we should pull in~~ I'll speak to the team about.

pauby avatar Jun 10 '24 14:06 pauby

I've moved the issue for this over to the checksum repository. Rather than changing the way we calculate hashes, we're going to look at improving checksum.exe so won't be progressing with this PR.

We appreciate you submitting it, @flcdrg. I'll leave this open for any further comments before closing it.

pauby avatar Jun 11 '24 10:06 pauby

Dear contributor,

As this PR seems to have been inactive for 30 days after changes / additional information was requested, it has been automatically closed. If you feel the changes are still valid, please re-open the PR once all changes or additional information that was requested has been added. Thank you for your contribution.

github-actions[bot] avatar Jul 27 '24 04:07 github-actions[bot]