我确实需要检查在 Windows PowerShell 中运行的命令的数值。
\n唯一$?
返回 True 或 False,但我需要实际的错误号。
那可能吗?在linux下就可以了,echo $?
但是在Windows下就很难了!
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