Sunday, May 12, 2019

Powershell: Start-Transcript

Due to security reason or audit purpose, operators are required to record an activity on the terminal.
Powershell provides session record/logging command, defined as 'Start-Transcript'.

> Start-Transcript -Path "pshell.log" -NoClobber
トランスクリプトが開始されました。出力ファイル: pshell.log

> ls

ディレクトリ: C:\Users\drago\

Mode LastWriteTime Length Name
---- ------------- ------ ----
------ 2018/12/11 10:51 4289310 IMG_20181211_194816.jpg
------ 2018/12/11 10:51 2320769 IMG_20181211_194840.jpg
------ 2018/12/11 10:51 3137062 IMG_20181211_194852.jpg
------ 2018/12/11 10:51 3223160 IMG_20181211_194856.jpg
------ 2018/12/11 10:51 3470993 IMG_20181211_194902.jpg
------ 2018/12/11 10:51 3977489 IMG_20181211_195032.jpg
-a---- 2018/06/15 14:23 52193 portrait-2.zip
-a---- 2019/05/12 23:12 759 pshell.log


>
>
> Stop-Transcript
**********************
Windows PowerShell トランスクリプト終了
終了時刻: 20190512231418
**********************



Add '-NoClobber' option for preventing the log be overwritten.

You can check the log file that you specified on '-Path' parameter of the command.
You can terminate the session, or just gently type 'Stop-Transcript' to end it.

No comments:

Post a Comment