According to pwsh documentation, I should be able to pass command-line arguments but I am getting errors instead (both from a PS prompt and from a CMD prompt):
> pwsh -NoExit
-NoExit : The term '-NoExit' is not recognized as the name of a cmdlet, function, script file, or operable program.
...
> pwsh -NoLogo
-NoLogo : The term '-NoLogo' is not recognized as the name of a cmdlet, function, script file, or operable program.
...
> pwsh -h
-h : The term '-h' is not recognized as the name of a cmdlet, function, script file, or operable program.
...
> pwsh -Command "Write-host hello"
-Command : The term '-Command' is not recognized as the name of a cmdlet, function, script file, or operable program.
...
PS> C:\Users\ericj\.dotnet\tools\pwsh.exe --help
At line:1 char:3
+ --help
...
Unexpected token 'help' in expression or statement.
PS> C:\Users\ericj\.dotnet\tools\pwsh.exe /?
/? : The term '/?' is not recognized as the name of a cmdlet, function, script file, or operable program.
PS> C:\Users\ericj\.dotnet\tools\pwsh.exe "write-host hello"
hello
PS> dotnet tool uninstall --global PowerShell
Tool 'powershell' (version '6.2.3') was successfully uninstalled.
PS> pwsh
pwsh : The term 'pwsh' is not recognized as the name of a cmdlet, function, script file, or operable program.
PS> get-command pwsh
get-command : The term 'pwsh' is not recognized as the name of a cmdlet, function, script file, or operable program.
PS> dotnet tool install --global PowerShell
You can invoke the tool using the following command: pwsh
Tool 'powershell' (version '6.2.3') was successfully installed.
PS> get-command pwsh
CommandType Name Version Source
----------- ---- ------- ------
Application pwsh.exe 6.2.3.0 C:\Users\ericj\.dotnet\tools\pwsh.exe
PS> pwsh /nologo
/nologo : The term '/nologo' is not recognized as the name of a cmdlet, function, script file, or operable program.
PS> pwsh /?
/? : The term '/?' is not recognized as the name of a cmdlet, function, script file, or operable program.
PS> pwsh --help
Missing expression after unary operator '--'.
Unexpected token 'help' in expression or statement.
PS> pwsh "write-host hello"
hello