Start-Transcript

 

SYNOPSIS

Creates a record of all or part of a Windows PowerShell session in a text file.

 

SYNTAX

Start-Transcript [[-path] <string>] [-force] [-noClobber] [-append] [-whatIf] [-confirm] [<CommonParameters>]

 

DETAILED DESCRIPTION

The Start-Transcript cmdlet creates a record of all or part of a Windows PowerShell session in a text file. The transcript includes all command that the user types and all output that appears on the console.

 

PARAMETERS

 

-path <string>

Specifies a location for the transcript file. Enter a path to a .txt file. Wildcards are not permitted.

 

If you do not specify a path, Start-Transcript uses the path in the value of the $Transcript global variable. If you have not created this variable, Start-Transcript stores the transcripts in the $Home\My Documents directory as \PowerShell_transcript.<time-stamp>.txt files.

 

If any of the directories in the path do not exist, the command fails.

 

Required?

false

Position?

1

Default value

variable

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-force <SwitchParameter>

Overrides restrictions that prevent the command from succeeding, just so the changes do not compromise security. For example, Force will override the read-only attribute or create directories to complete a file path, but it will not attempt to change file permissions.

 

Required?

false

Position?

named

Default value

False

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-noClobber <SwitchParameter>

Will not overwrite (replace the contents) of an existing file. By default, if a transcript file exists in the specified path, Start-Transcript overwrites the file without warning.

 

Required?

false

Position?

named

Default value

False

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-append <SwitchParameter>

Adds the new transcript to the end of an existing file. Use the Path parameter to specify the file.

 

Required?

false

Position?

named

Default value

Force

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-whatIf

Describes what would happen if you executed the command without actually executing the command.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".

 

NOTES

 

For more information, type "Get-Help Start-Transcript -detailed". For technical information, type "Get-Help Start-Transcript -full".

 

When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

 

To stop a transcript, use the Stop-Transcriptcmdlet.

 

To record an entire session, add the Start-Transcript command to your profile. 

EXAMPLE 1

 

start-transcript

 

This command starts a transcript in the default file location.

 

EXAMPLE 2

 

start-transcript -path c:\transcripts\transcript0.txt -noclobber

 

This command starts a transcript in the Transcript0.txt file in C:\transcripts. The NoClobber parameter prevents any existing files from being overwritten. If the Transcript0.txt file already exists, the command fails.

 

RELATED LINKS

Stop-Transcript