PowerShell transcript file doesn't contain the correct information in Windows Server 2012 R2

Windows Server 2012 R2 DatacenterWindows Server 2012 R2 EssentialsWindows Server 2012 R2 Foundation

Symptoms


On a server that's running Windows Server 2012 R2, you encounter one or more of the following issues when you use PowerShell:
  • Issue 1

    The Start-Transcript cmdlet does not capture write-host calls, as seen in the following script example:

    Start-Transcript -path $env:TEMP\transcript.txt
    Write-Host Hello World
    Stop-Transcript
    Get-Content $env:TEMP\transcript.txt
    In this case, "Hello World" does not appear in the transcript.txt file as expected.

  • Issue 2

    The Start-Transcript cmdlet captures unnecessary information when you use the tab completion feature, as seen in the following script example:

    Start-Transcript -path $env:TEMP\transcript.txt
    <Tab-complete any command>
    Stop-Transcript
    Get-Content $env:TEMP\transcript.txt
    In this case, the transcript file contains information that resembles the following:

    CurrentMatchIndex    ReplacementIndex    ReplacementLength CompletionMatches
    ----------------- ---------------- -----------------------------------
    -1 0 7 {System.Management.Automat..

    Note You do not expect the transcript to contain internal information of this sort.

  • Issue 3

    The Start-Transcript cmdlet does not correctly append to existing transcripts after you install the November 2014 update rollup . The following scenarios illustrate this issue:
    • On a server that has the November 2014 update rollup installed, you run the following script:

      Start-Transcript –path $env:TEMP\transcript.txt –Append –Force
      Stop-Transcript

    • On a server that does not have the November 2014 update rollup installed, you run the following script:

      Start-Transcript -path $env:TEMP\transcript.txt
      Write-Host Hello World
      Stop-Transcript

    When the November 2014 update rollup is installed in these scenarios, the transcript contains incorrect data. You expect the transcript to contain the original text.

Resolution


Hotfix information

A supported hotfix is available from Microsoft Support. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, go to the following Microsoft website: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this update, you must first have update 2919355 installed in Windows Server 2012 R2.

Restart requirement

You must restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any previously released hotfix.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the terminology that Microsoft uses to describe software updates.