From b090998d65dd6efef00fb97861d74f84696386fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=20Alexander=20=F0=9F=91=91?= Date: Thu, 19 Nov 2026 07:54:18 -0600 Subject: [PATCH 1/3] docs(install): Windows PowerShell 5.1 started from PowerShell 7 A powershell.exe started from a pwsh session inherits PSModulePath and cannot load Get-FileHash, so install.ps1 stops at the checksum step with a "Download failed" error that points at the release. Say that nothing is installed and how to run the installer instead: under pwsh, from a 5.1 started outside PowerShell 7, or with PSModulePath cleared for the child. No installer change. --- docs/installation.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index 33f59b57..eea119ff 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -86,6 +86,37 @@ The local-binary path does not authenticate the file for you. Verify its origin and digest before installing it. The shell installer may still resolve the latest release if no `--version` is supplied, even with `--binary`. +### Windows PowerShell 5.1 started from PowerShell 7 + +`install.ps1` runs under PowerShell 7 (`pwsh`) and under Windows PowerShell 5.1 +(`powershell`). A Windows PowerShell 5.1 started from inside a PowerShell 7 +session inherits PowerShell 7's `PSModulePath` and cannot load its own modules, +including the one that provides `Get-FileHash`. The installer then fails at the +checksum step with an error such as: + +``` +Download failed: The term 'Get-FileHash' is not recognized as the name of a cmdlet, ... +Check that release v exists for windows-x86_64: +``` + +The release exists; the shell is the problem. The installer stops before it +extracts the archive, so nothing is installed and an existing install is left +as it was. Run it in one of these ways instead: + +- Run it under PowerShell 7: `pwsh -NoProfile -File .\install.ps1`. +- Start Windows PowerShell 5.1 from the Start menu or from a Command Prompt that + was not itself started from PowerShell 7, then run `.\install.ps1` there. +- From PowerShell 7, start Windows PowerShell 5.1 without the inherited + variable, so it builds its own module path: + + ```powershell + $saved = $env:PSModulePath + $env:PSModulePath = $null + try { powershell -NoProfile -File .\install.ps1 } finally { $env:PSModulePath = $saved } + ``` + +Pass the installer's parameters after `.\install.ps1` in each case. + ### Archive verification For releases with `SHA256SUMS`, obtain the archive and manifest from the same From 0970d17186ab862461a3ffa7b47ce1ba5d4dfa9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=20Alexander=20=F0=9F=91=91?= Date: Thu, 19 Nov 2026 07:59:28 -0600 Subject: [PATCH 2/3] docs(install): only a 5.1 started through another program is affected PowerShell 7 strips its own module paths for a powershell.exe it starts directly; the inherited PSModulePath breaks a 5.1 started through cmd, Python or another intermediate. Use Microsoft's cmd form to clear the variable, and note execution policy, the PATH and -Binary. --- docs/installation.md | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index eea119ff..51e6fe36 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -86,36 +86,46 @@ The local-binary path does not authenticate the file for you. Verify its origin and digest before installing it. The shell installer may still resolve the latest release if no `--version` is supplied, even with `--binary`. -### Windows PowerShell 5.1 started from PowerShell 7 +### Windows PowerShell 5.1 started through another program from PowerShell 7 `install.ps1` runs under PowerShell 7 (`pwsh`) and under Windows PowerShell 5.1 -(`powershell`). A Windows PowerShell 5.1 started from inside a PowerShell 7 -session inherits PowerShell 7's `PSModulePath` and cannot load its own modules, -including the one that provides `Get-FileHash`. The installer then fails at the -checksum step with an error such as: +(`powershell`). Typing `powershell` at a PowerShell 7 prompt is fine: PowerShell +7 removes its own module paths from `PSModulePath` for a Windows PowerShell it +starts directly. A Windows PowerShell started through another program that +PowerShell 7 launched, such as `cmd.exe`, Python, a build tool or an editor +task, inherits PowerShell 7's `PSModulePath` unchanged. It then finds PowerShell +7's copies of built-in modules first, cannot load them, and cannot auto-load some +commands, including `Get-FileHash`. See +[about_PSModulePath](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_psmodulepath). + +The installer then fails at the checksum step with output such as: ``` Download failed: The term 'Get-FileHash' is not recognized as the name of a cmdlet, ... Check that release v exists for windows-x86_64: + https://github.com/OpenCoven/coven-code/releases/tag/v ``` The release exists; the shell is the problem. The installer stops before it -extracts the archive, so nothing is installed and an existing install is left -as it was. Run it in one of these ways instead: +extracts the archive: no executable is installed, an existing install is left +as it was, and the user PATH is not changed. Run it in one of these ways +instead: - Run it under PowerShell 7: `pwsh -NoProfile -File .\install.ps1`. -- Start Windows PowerShell 5.1 from the Start menu or from a Command Prompt that - was not itself started from PowerShell 7, then run `.\install.ps1` there. -- From PowerShell 7, start Windows PowerShell 5.1 without the inherited - variable, so it builds its own module path: - - ```powershell - $saved = $env:PSModulePath - $env:PSModulePath = $null - try { powershell -NoProfile -File .\install.ps1 } finally { $env:PSModulePath = $saved } +- Start Windows PowerShell 5.1 from the Start menu, or from a Command Prompt + that was not itself started from PowerShell 7, and run it there. +- Clear the variable for the Windows PowerShell you start, so it builds its own + module path. This works from any shell: + + ``` + cmd /c "set PSModulePath=&& powershell -NoProfile -File .\install.ps1" ``` -Pass the installer's parameters after `.\install.ps1` in each case. +Pass the installer's parameters after `.\install.ps1`. If running scripts is +disabled on the system, add `-ExecutionPolicy Bypass` to that one command after +you have inspected the script. Installs with `-Binary` do not use +`Get-FileHash` and are not affected, but check that binary's digest in a shell +that can load `Get-FileHash`, such as PowerShell 7. ### Archive verification From 1bbcd72490dae3861ebbfcca82f0a239d710d527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=20Alexander=20=F0=9F=91=91?= Date: Thu, 19 Nov 2026 08:10:25 -0600 Subject: [PATCH 3/3] docs(install): execution policy placement, shells for the cmd form, certutil Review follow-up: -ExecutionPolicy goes before -File; the cmd one-liner needs a Command Prompt or PowerShell in a local folder; a Command Prompt started indirectly from PowerShell 7 inherits the variable too; name the error in the heading. --- docs/installation.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 51e6fe36..353a8181 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -86,7 +86,7 @@ The local-binary path does not authenticate the file for you. Verify its origin and digest before installing it. The shell installer may still resolve the latest release if no `--version` is supplied, even with `--binary`. -### Windows PowerShell 5.1 started through another program from PowerShell 7 +### Windows PowerShell 5.1: 'Get-FileHash' is not recognized `install.ps1` runs under PowerShell 7 (`pwsh`) and under Windows PowerShell 5.1 (`powershell`). Typing `powershell` at a PowerShell 7 prompt is fine: PowerShell @@ -108,24 +108,29 @@ Check that release v exists for windows-x86_64: The release exists; the shell is the problem. The installer stops before it extracts the archive: no executable is installed, an existing install is left -as it was, and the user PATH is not changed. Run it in one of these ways -instead: +as it was, and the user PATH is not changed (the install directory may be left +behind, empty). Run it in one of these ways instead: - Run it under PowerShell 7: `pwsh -NoProfile -File .\install.ps1`. - Start Windows PowerShell 5.1 from the Start menu, or from a Command Prompt - that was not itself started from PowerShell 7, and run it there. + that was not started from PowerShell 7, directly or through another program, + and run it there. - Clear the variable for the Windows PowerShell you start, so it builds its own - module path. This works from any shell: + module path. This works from a Command Prompt or PowerShell, run in the folder + that holds `install.ps1` (not a `\\server\share` path): ``` cmd /c "set PSModulePath=&& powershell -NoProfile -File .\install.ps1" ``` Pass the installer's parameters after `.\install.ps1`. If running scripts is -disabled on the system, add `-ExecutionPolicy Bypass` to that one command after -you have inspected the script. Installs with `-Binary` do not use -`Get-FileHash` and are not affected, but check that binary's digest in a shell -that can load `Get-FileHash`, such as PowerShell 7. +disabled, and you have inspected the script, put `-ExecutionPolicy Bypass` +before `-File` (for example `pwsh -NoProfile -ExecutionPolicy Bypass -File +.\install.ps1`); at an interactive prompt, run +`Set-ExecutionPolicy -Scope Process Bypass` first. Installs with `-Binary` do +not use `Get-FileHash` and are not affected, but check that binary's digest in +a shell that can load `Get-FileHash`, such as PowerShell 7, or with +`certutil -hashfile SHA256`. ### Archive verification