如何将 PowerShell 窗口(输入和输出)中发生的一切自动重定向到文件?我不是指单个命令,而是我想要一个类似记录器的东西,它可以捕获所有内容并记录到本地文件中,这样我就有了在 powershell 窗口中完成的事情的历史记录。
最佳答案
您正在寻找 PowerShell 的 Start-Transcript
cmdlet,其中:
creates a record of all or part of a Windows PowerShell session to a text file. The transcript includes all command that the user types and all output that appears on the console.
必须使用 Stop-Transcript
显式停止正在运行的转录本cmdlet。
关于powershell - 如何自动保存 PowerShell session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48978251/