Steps to reproduce
On Linux, install PowerShell global tool as per the blog post from the PowerShell team:
https://devblogs.microsoft.com/powershell/introducing-powershell-as-net-global-tool/
dotnet tool install --global PowerShell
Then, run from bash:
pwsh "exit 1"; echo $LASTEXITCODE
Note: I'm not using -C because of issue #10355.
Expected behavior
It outputs 1.
Actual behavior
It outputs 0.
Environment data
$PSVersionTable:
Name Value
---- -----
PSVersion 6.2.2
PSEdition Core
GitCommitId 6.2.2
OS Linux 4.4.0-18362-Microsoft #1-Microsoft Mon Mar 18 12:02:00 PST 2019
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Remarks
This works as expected on Linux if pwsh is not installed as a dotnet global tool.
Steps to reproduce
On Linux, install PowerShell global tool as per the blog post from the PowerShell team:
https://devblogs.microsoft.com/powershell/introducing-powershell-as-net-global-tool/
Then, run from bash:
Note: I'm not using
-Cbecause of issue #10355.Expected behavior
It outputs
1.Actual behavior
It outputs
0.Environment data
$PSVersionTable:
Remarks
This works as expected on Linux if pwsh is not installed as a dotnet global tool.