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 -c Get-ChildItem
pwsh --version
Expected behavior
The global dotnet tool works as a regular pwsh install, so, to run a command, you would run:
And the output would be successful.
Actual behavior
Both will fail. AFAIK any command with an argument will fail. This is what I get when I run the first one:
-Command : The term '-Command' is not recognized as the name of a cmdlet, function, script file, or operable program.
And the second one:
Missing expression after unary operator '--'. At line:1 char:3 + --version + ~~~~~~~ Unexpected token 'version' in expression or statement.
Also, if you run without -C (or -Command), it works, which is not expected:
Environment data
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
This is running on WSL on Ubuntu 19.04.
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 PowerShellThen run, from bash:
Expected behavior
The global dotnet tool works as a regular pwsh install, so, to run a command, you would run:
And the output would be successful.
Actual behavior
Both will fail. AFAIK any command with an argument will fail. This is what I get when I run the first one:
And the second one:
Also, if you run without
-C(or-Command), it works, which is not expected:Environment data
This is running on WSL on Ubuntu 19.04.