powershell - 如何自动保存 PowerShell session

标签 powershell logging transcription

如何将 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/

相关文章:

loops - 为什么我不能将哈希表存储在数组列表中?

powershell - 管道foreach循环CSV PowerShell

windows - 从 powershell 递归归档某种类型的所有文件

c# - 将值传递给 nlog 自定义目标

python - 使用 Python 将日志轮换到目录中

ios - 是否可以转录 Twilio 调用 "as you speak"?

powershell - Powershell Format-Hex不显示行尾。为什么?

Javascript - 读取经常更新的文件

java - Java 中 Wav 文件的音乐转录