Windows Shellscript中的“ script”命令是否等效?

Man*_*mar 2 windows powershell command-line

GNU / Linux机器上有脚本命令,该脚本命令可将所有命令行活动捕获到文件中。这是非常有用的工具,尤其是当我们学习新知识并且想要保存命令及其输出以供将来参考时。

我目前正在Windows PowerShell终端上学习Git ,我想将所有命令及其输出捕获到文件中,以备将来参考。

有什么方法/命令可以在Windows PowerShell上实现吗?

JPB*_*anc 5

它存在标准CmdLets:Start-TranscriptStop-Transcript

您可以在相关的TechNet文档中找到有关这些CmdLet的更多信息。


wal*_*umi 5

尝试使用Start-TranscriptStop-Transcriptcmdlet。

您也可以将“ 开始转录”用于ISE编辑器模块,因为这些CmdLet不能在ISE中本地运行