小编DEK*_*KER的帖子

如何查看在 PowerShell 控制台中运行的程序的退出代码

我确实需要检查在 Windows PowerShell 中运行的命令的数值。

\n

唯一$?返回 True 或 False,但我需要实际的错误号。

\n

那可能吗?在linux下就可以了,echo $?但是在Windows下就很难了!

\n
PS C:\\work\\> copy\n\nCmdlet Copy-Item an der Befehlspipelineposition 1\nGeben Sie Werte f\xc3\xbcr die folgenden Parameter an:\nPath[0]:\nPS C:\\work\\> echo $?\nFalse\nPS C:\\work\\>\n
Run Code Online (Sandbox Code Playgroud)\n

当您在这里时,正常命令提示符的解决方案是什么?

\n

windows powershell windows-10

2
推荐指数
1
解决办法
7919
查看次数

标签 统计

powershell ×1

windows ×1

windows-10 ×1