相关疑难解决方法(0)

如何在PowerShell中写入标准错误?

我无法弄清楚如何回显标准错误流并重定向可执行文件的错误流.

我来自Bourne shellKorn shell背景,我将使用它;

# Write to stderr
echo "Error Message!" >&2

# Redirect stderr to file
/do/error 2>/tmp/err.msg
Run Code Online (Sandbox Code Playgroud)

powershell stderr powershell-2.0

41
推荐指数
3
解决办法
3万
查看次数

如何使用详细输出运行PowerShell脚本?

我想知道是否有办法运行PowerShell脚本,以便打印脚本的每一行的命令和输出.例如,在Bash中,您可以在脚本的顶部编写bash -x myscript或放置一个set -x.在批处理中,您将省略@echo off传统上留在脚本顶部的内容.PowerShell是否具有这些结构的等价物?

我尝试过的事情:跑步powershell -? | sls verbose,没有任何结果.

windows shell powershell windows-10

17
推荐指数
4
解决办法
4万
查看次数

标签 统计

powershell ×2

powershell-2.0 ×1

shell ×1

stderr ×1

windows ×1

windows-10 ×1