我需要一个行脚本,做这样的事情:PowerShell命令
if (results from PowerShell command not empty) do something
PowerShell命令基本上是
powershell -command "GetInstalledFoo"
我试图if (powershell -command "GetInstalledFoo" != "") echo "yes"
,但得到的错误-command was unexpected at this time.
这可能实现吗?该命令最终将作为cmd /k
的命令运行。