Repository navigation
Prefer PowerShell 7 in Cmder profiles and pwsh - #3144
Open
DRSDavidSoft wants to merge 3 commits into
Open
DRSDavidSoft wants to merge 3 commits into
DRSDavidSoft wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default PowerShell profiles and
pwshalias currently launch Windows PowerShell even when PowerShell 7 is installed. This changes the normal and administrator Cmder profiles in ConEmu and Windows Terminal, the command alias, and the launcher's terminal-free PowerShell task to use one shared host selector.pwsh.exeapplications onPATH, requiring PowerShell 7 or later. Fall back to Windows PowerShell when none is available.pwsh -Version,-File, or-Commandkeep native CLI behavior and return the child's exit code.pwsh=entry. The explicitly named Windows PowerShell profile still selects that shell.Validation: 48 assertions passed in each of Windows PowerShell 5.1 and PowerShell 7, covering installed and portable discovery, skipping PowerShell 6 and current-directory executables, both terminal profiles and administrator command forms with delayed expansion initially enabled, CLI arguments, exit codes, separate configuration, and paths with spaces,
&, apostrophes, and paired!name!segments. The path regression test also fails when the production/v:offoverride is removed. Real Windows PowerShell and PowerShell 7 loaded an isolated profile successfully. Win32/x64 launcher regression tests, all four native launcher build configurations, the integrated-Compile -NoVendorbuild, vendor-update smoke test, actionlint, and whitespace checks passed. All nine archive variants from the production packer preserved the exact built launcher and PowerShell profile payload in both shells, using synthetic vendor fixtures with integrity, vendor-selection, private-config exclusion, and SHA-256 checks. CI runs the host-selection tests in both PowerShell versions.Selection follows Microsoft's PowerShell installation locations. Terminal GUI and elevated interactive sessions remain separate acceptance checks; these tests execute the shipped command forms without elevating or changing user settings.