When running the Coreutils for Windows installer, the setup fails with a runtime error during the PowerShell profile update phase. The pwsh-install.ps1 script hardcodes a check for the InstallDir registry value under HKLM:\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\<GUID>.
However, that value doesn't seem to exist on my system. Instead, I see an InstallLocation value in that same location. I'm not 100% certain, but I believe modern PowerShell installers may now use InstallLocation rather than InstallDir, at least that's what's present on my machine. The script may need to account for this newer value.
Environment Details
PS ❯ $PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 6 2
Edition Windows 10 Enterprise
Version 22H2
OS Build 19045.7291

When running the Coreutils for Windows installer, the setup fails with a runtime error during the PowerShell profile update phase. The
pwsh-install.ps1script hardcodes a check for theInstallDirregistry value underHKLM:\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\<GUID>.However, that value doesn't seem to exist on my system. Instead, I see an
InstallLocationvalue in that same location. I'm not 100% certain, but I believe modern PowerShell installers may now useInstallLocationrather thanInstallDir, at least that's what's present on my machine. The script may need to account for this newer value.Environment Details