(#3462) Use Get-FileHash cmdlet where possible
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
Was Get-FileHash available in PowerShell version 3.0?
I'm assuming not, as it isn't listed in the 3.0 docs, but is for 4.0
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.
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.
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.