Please feel free to provide feedback or file bugs here.

Write-Host -NoNewLine and Transcription

Starting with WMF 5.0 the -NoNewLine option for Write-Host is essentially ignored in the transcripts created using Start-Transcript.

Simple example script:

Start-Transcript log.txt
Write-Host -NoNewLine "this should all"
Write-Host -NoNewLine "be on one line"
Write-Host -NoNewLine "in the log.txt file"
Stop-Transcript

8 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Evan Swanson shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Sree Prakash A/L Baskaran commented  ·   ·  Flag as inappropriate

        Does not work for me. My Powershell version is 5.1.16299.251

        Below is my log:

        **********************
        Windows PowerShell transcript start
        Start time: 20180424123603
        Username: DESKTOP-1EGI5MF\Lenovo
        RunAs User: DESKTOP-1EGI5MF\Lenovo
        Configuration Name:
        Machine: DESKTOP-1EGI5MF (Microsoft Windows NT 10.0.16299.0)
        Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
        Process ID: 10304
        PSVersion: 5.1.16299.251
        PSEdition: Desktop
        PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.16299.251
        BuildVersion: 10.0.16299.251
        CLRVersion: 4.0.30319.42000
        WSManStackVersion: 3.0
        PSRemotingProtocolVersion: 2.3
        SerializationVersion: 1.1.0.1
        **********************
        Transcript started, output file is log.txt
        this should all
        be on one line
        in the log.txt file
        **********************
        Windows PowerShell transcript end
        End time: 20180424123603
        **********************

      Feedback and Knowledge Base