0

コマンド/PowerShellウィンドウの画面バッファーをC/C ++/PowerShellを使用してテキストファイルにコピーしたいと思います。

それを行う方法はありますか?

4

2 に答える 2

1

ホストコンソールAPIを使用します:-

$rec = new-object System.Management.Automation.Host.Rectangle 0,0,($host.ui.rawui.BufferSize.Width  - 1),$host.ui.rawui.CursorPosition.Y
$buffer = $host.ui.rawui.GetBufferContents($rec)

>>または|を使用してファイルにバッファを書き込みます

于 2012-12-14T05:02:36.713 に答える
0

Start-Transcriptとの使用はどうStop-Transcriptですか?

Technet:WindowsPowerShellで行うことのトランスクリプトを作成する

于 2014-01-21T04:29:10.253 に答える