我正在尝试在Ubuntu上的PowerShell Core(6.2.3)中执行内联命令。 这会引发错误: -Command:术语“ -Command”不被视为cmdlet,函数,脚本文件或可运行程序的名称。 如果有帮助,我将PowerShell安装为dotnet核心全局工具。 答案 0 :(得分:0) 传递不带参数名称的命令: Microsoft's documentation shows that the parameter name is required,所以也许这是安装pwsh -Command "Write-Host 'Hello, world'"
1 个答案:
pwsh "Write-Host 'Hello, world'"
pwsh
作为dotnet核心工具的怪癖。