PowerShell “echo on”

前端 未结 4 1913
忘掉有多难
忘掉有多难 2020-12-24 01:03

This is a duplicate of https://serverfault.com/questions/102098/powershell-script-showing-commands-run. I thought it would be more appropriate to ask this question here.

4条回答
  •  自闭症患者
    2020-12-24 01:40

    Start-Transcript doesn't catch any exe output. That's a show stopper for me. I hate to say it but the best way I've found to do this is:

    cmd /c powershell.exe -file c:\users\hillr\foo.ps1 > foo.log
    

    This captures everything AFAICT.

提交回复
热议问题