Nel*_*mel 27 powershell command echo
这是https://serverfault.com/questions/102098/powershell-script-showing-commands-run的副本.我认为在这里提出这个问题会更合适.
我正在玩PowerShell脚本,他们工作得很好.但是,我想知道是否还有任何方法可以显示所有运行的命令,就像你自己手动输入它们一样.这与批处理文件中的"echo on"类似.我查看了PowerShell命令行参数cmdlet,但我没有找到任何明显的参数.
wis*_*cky 14
Set-PSDebug -Trace 1
Run Code Online (Sandbox Code Playgroud)
有关更多信息:https : //docs.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/set-psdebug?view=powershell-6
Start-Transcript不会捕获任何exe输出.这对我来说是个噱头.我不想这么说,但我发现这样做的最好方法是:
cmd /c powershell.exe -file c:\users\hillr\foo.ps1 > foo.log
Run Code Online (Sandbox Code Playgroud)
这捕获了AFAICT的一切.
| 归档时间: |
|
| 查看次数: |
21483 次 |
| 最近记录: |