Start-Transcript

Start a transcript of a command shell session, record the session to a text file.

Syntax
      Start-Transcript [-Path] string] [-Force] [-noClobber]
              [-Append] [-WhatIf] [-Confirm] [CommonParameters]
Key
   -Path string
       The path to the transcript file. 

   -Force
       Override restrictions that prevent the command from succeeding, apart
       from security settings. e.g. override a files read-only attribute.

   -NoClobber 
       Do not overwrite an existing file.

   -Append 
       Add the new transcript to the end of an existing file.

   -WhatIf
       Describe what would happen if you executed the command without
       actually executing the command.

   -Confirm
       Prompt for confirmation before executing the command.

Start-Transcript creates a record of a PowerShell session in a text file. The transcript file includes all commands typed and all the console output.

If no path is specified, Start-Transcript will use the path in the value of the $Transcript global variable. If this variable has not been set, Start-Transcript will store the transcripts in $Home\My Documents\PowerShell_transcript.<time-stamp>.txt

Under Windows, Start-Transcript will create UTF-8 files with BOM by default.
Start-Transcript -Append partially matches an existing encoding, it will correctly match encodings with a BOM, but will default to potentially lossy ASCII encoding in the absence of one.
This can be configured by setting the $PSDefaultParameterValues preference variable.
Under PowerShell Core edition, the encoding defaults to BOM-less UTF-8

Examples

Start a transcript:

PS C:\> start-transcript -path c:\docs\MyTranscript.txt

“Scholars who contemplate on their thoughts and translate them into actions are the ones who are really great and noble” ~ Rig Veda

Related PowerShell Cmdlets

Stop-Transcript - Stop the transcription process.
Equivalent bash command: Script - Start a transcript of a shell session.


 
Copyright © 1999-2024 SS64.com
Some rights reserved