-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Area-Maintainers-Buildspecific to affecting the buildspecific to affecting the buildIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more
Description
When PowerShell is installed as a .NET global tool, it prepends its own $PSHOME folder to $env:PATH.
However, on macOS $PSHOME contains an incompatible pwsh binary that is for Linux.
Therefore, from within an existing session, invoking pwsh (by mere file name) unexpectedly fails.
Steps to reproduce
# Install PowerShell as a .NET global tool, to ~/.dotnet/tools
dotnet tool install powershell -g
# Invoke it, and try to re-invoke its own CLI.
~/.dotnet/tools/pwsh -noprofile -c 'pwsh -noprofile -c write-output hi' | Should -Be 'hi'Expected behavior
The test should succeed.
Actual behavior
The test fails, due to incompatible binary being invoked:
Expected 'hi', but got @('ResourceUnavailable: Program 'pwsh' failed to run: Exec format errorAt line:1 char:1' ...
Environment data
PowerShell Core v7.0.0 (7.0.0) on macOS 10.15.3
Metadata
Metadata
Assignees
Labels
Area-Maintainers-Buildspecific to affecting the buildspecific to affecting the buildIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more