none
Need Start-Transcript to create a new txt every time script runs RRS feed

  • Question

  • I am currently running in my script: start-transcript -path "C:\Scripts\Transcription\Grp_Renwl.txt" -Append.  This method runs correctly, but what I need the Start-Transcript to create a new txt every time script runs.

    Expected results:
    Grp_Renwl.txt
    Grp_Renwl_1.txt
    Grp_Renwl_2.txt

    -or-

    Grp_Renwl_MM:DD:YYYY.txt

    Any help would be greatly appreciated.

    Thursday, March 21, 2019 6:01 AM

Answers

  • Start-Transcript always starts a new file each time it is executed.

    "PowerShell_transcript.ALPHA.XYuQ8ocn.20190321080657.txt"

    The name contains a full timestamp and the computer name as well as unique ID.


    \_(ツ)_/


    Thursday, March 21, 2019 12:09 PM

All replies

  • You should carefully read the help about the cmdlets Start-Transript and Get-Date including all the examples. Just an example/tip:
    Get-Date -Format 'yyyy-MM-dd'
    BTW: If I remember right - colons are not allowed in Windows file names.  ;-)

    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    • Proposed as answer by I.T Delinquent Thursday, March 21, 2019 9:06 AM
    Thursday, March 21, 2019 7:15 AM
  • Start-Transcript always starts a new file each time it is executed.

    "PowerShell_transcript.ALPHA.XYuQ8ocn.20190321080657.txt"

    The name contains a full timestamp and the computer name as well as unique ID.


    \_(ツ)_/


    Thursday, March 21, 2019 12:09 PM