dotnet / install-scripts

MIT License
145 stars 76 forks source link

dotnet-install.ps1 causes hash mismatch error #541

Closed kit494way closed 1 week ago

kit494way commented 2 weeks ago

Executing dotnet-install.ps1 which is download from https://dot.net/v1/dotnet-install.ps1 causes hash mismatch error.

$ .\dotnet-install.ps1 -Channel 7.0 -DryRun
.\dotnet-install.ps1: File C:\Users\kita9\dotnet-install.ps1 cannot be loaded. The contents of file C:\Users\kita9\dotnet-install.ps1 might have been changed by an unauthorized user or process, because the hash of the file does not match the hash stored in the digital signature. The script cannot run on the specified system. For more information, run Get-Help about_Signing..
JanProvaznik commented 2 weeks ago

I suspect https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/signed-powershell-script-fails-hash-mismatch . Do you have other than en-US locale?

kit494way commented 2 weeks ago

Yes, I use ja-JP locale.

JanProvaznik commented 2 weeks ago

It looks like a bug we'd like to fix. As a workaround for now you can

  1. change locale to en-US OR
  2. use the unsigned script https://github.com/dotnet/install-scripts/blob/1dcf16184e58f1d4f8bbb0f9d34b85f0c439ecdd/src/dotnet-install.ps1 which is the same as the one on the website
  3. If you need it signed, you can self-sign by following this guide https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_signing
JanProvaznik commented 1 week ago

@kit494way the fix was released

kit494way commented 1 week ago

Thanks. I confirm that the issue has been resolved.