-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error starting PowerShell 7.4.0+ #20706
Comments
Can you check with "Add or Remove programs" settings that there is only one PowerShell MSI installed, and you don't have both 7.3.9 and 7.4.0? The reason I say that is I found I had both installed, one with a normal MSI icon, the other with a PowerShell icon. |
@rhubarb-geek-nz I did, I hadn't. |
There are at least 4 ways to install Pwsh on Windows: |
First I tried via winget. Then via the MSI download. Same result. |
Have you tried completely uninstalling the previous MSI first? Not ideal I know, in-place updates should work. Use "Add or Remove programs" to see what is installed, and also check the directory "c:\Program Files\PowerShell\7" |
Alas, there are enough other problems with 7.4.0 to suggest sticking with 7.3.10 ( for the moment ). |
I have tracked the error and added the explanation of why it is happening to the additional context section of the issue. |
I am also experiencing this issue. I've had to use PSModulePath environment variable within System Properties in the meantime, which is not a perfect workaround. |
There is a bug in PowerShell that is making it fail. See: PowerShell/PowerShell#20706
On Linux:
On Windows:
Azure DevOps pipeline yaml to reproduce the issue:
|
Any updates? |
I have reproduced this issue on Powershell 7.4.6 locally. This works:
This does not:
File Path: This seems like a clear case of regression. Please investigate and fix. |
Couple more notes. This is still broken in Powershell Preview 7.5:
Also, note that in the example I listed in my last comment, the semicolon delimiter by itself alone is enough to break the startup of powershell. According to this document, Editing the config file is described here:
|
Opened #24568 to fix this problem. |
Prerequisites
Steps to reproduce
powershell.config.json
and setPSModulePath
to multiple paths, separated by;
(path separator char) (see reference).Expected behavior
It starts, like 7.3 did.
Actual behavior
It fails with:
Error details
Not possible.
Environment data
Not possible, but it is version 7.4.0.
Visuals
This is starting from Nushell:
This is starting it from Windows Terminal:
Additional context
Downloaded and installed this file: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.msi
I debugged and found out that the exception is ocurring at this location (
ModuleIntrinsics.UpdatePath
):PowerShell/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs
Line 1278 in ad2bf78
The arguments for
UpdatePath
are:path: a string with a
;
separated list of pathspathToAdd: another string with a
;
separated list of pathsinsertIndex: 0
The call that is failing is the one to
path.IndexOf
, which is passed;
and-1
(which is the result from the call toPathContainsSubstring
).The problem only happens because
pathToAdd
has several paths with the;
separator. If it was a single path without;
it would work.The issue seems to have been introduced in commit 3710671.
The text was updated successfully, but these errors were encountered: