0

I'm trying to figure out what could cause Powershell's Get-FileHash to start returning a different checksum for an unchanged file but I can't find any information about how Get-FileHash works

I'm using the code

$hash = Get-FileHash -Path $filePath -Algorithm MD5

The file that is being checked is coming out of git (as is the powershell script), so I can see it hasn't been altered in months, but suddenly we're getting a different hash returned

The VM this code is running on was recreated yesterday, but i've re-built the server several times over the last few months without this occurring

Is it possible that a .net update is causing this issue, or could a change of architecture have caused it?

dave clements
  • 1,505
  • 2
  • 13
  • 28

1 Answers1

1

The file that is being checked is coming out of git

Could this be because GIT converts line ending during checkout (core.autocrlf option)?

Relevant question: How line ending conversions work with git core.autocrlf between different operating systems

Community
  • 1
  • 1
beatcracker
  • 6,714
  • 1
  • 18
  • 41