Repository navigation
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
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-Job results 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, then Start-Job works 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:PATH when pwsh starts up, so the pwsh in that location is the first one found in a path search. I tried altering my path to remove that directory, but Start-Job still uses the pwsh in 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
PS> Start-Job -ScriptBlock {}
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Running True localhost
PS> Get-Job
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Completed False localhostActual behavior
PS> Start-Job -ScriptBlock {}
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Failed False localhost
PS> Receive-Job 1
OpenError: [localhost] An error occurred while starting the background process. Error reported: An error occurred trying to start process '/Users/dlnash/.dotnet/tools/.store/powershell/7.2.6/powershell/7.2.6/tools/net6.0/any/unix/pwsh' with working directory '/Users/dlnash'. Exec format error.
PS> cd ~/.dotnet/tools/.store/powershell/7.2.6/powershell/7.2.6/tools/net6.0/any/unix
PS> file pwsh
pwsh: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=8a0b623bb0e55e510d8c7fc1f38184ce019bb0d3, for GNU/Linux 2.6.32, strippedError details
No response
Environment data
Name Value
---- -----
PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Darwin 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Activity
dlnash18 commentedon Sep 21, 2022
I suppose I should have included this in the actual behavior as well:
microsoft-github-policy-service commentedon Nov 15, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 15, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 15, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 22, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.