Start-Job fails on macOS when pwsh is installed as a global tool #18139
Labels
Issue-Bug
Issue has been identified as a bug in the product
Needs-Triage
The issue is new and needs to be triaged by a work group.
WG-DevEx-Portability
authoring cross-platform or cross-architecture modules, cmdlets, and scripts
Prerequisites
Steps to reproduce
I installed the .NET 6.0.401 on macOS 12.6 x86, then installed PowerShell 7.2.6 as a global tool. Using
Start-Jobresults in a failed job. The problem is that ~/.dotnet/tools/.store/powershell/7.2.6/powershell/7.2.6/tools/net6.0/any/unix/pwsh is a Linux ELF executable, not Mach-O. If I move ~/.dotnet/tools/.store/powershell/7.2.6/powershell/7.2.6/tools/net6.0/any/unix/pwsh out of the way and replace it with a symlink to ~/.dotnet/tools/pwsh, thenStart-Jobworks as expected.I noticed that ~/.dotnet/tools/.store/powershell/7.2.6/powershell/7.2.6/tools/net6.0/any/unix gets prepended to
$Env:PATHwhenpwshstarts up, so thepwshin that location is the first one found in a path search. I tried altering my path to remove that directory, butStart-Jobstill uses thepwshin that location. Only replacing the ELF binary with a link to the Mach-O binary fixes the problem, although I don't know if this might result in other issues (I haven't run into any yet).Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: