Start-Transcript: This host does not support transcription

前端 未结 7 2037
难免孤独
难免孤独 2021-02-05 04:50

I want to start a transcript on a Windows Server 2008 R2

Start-Transcript -path C:\\Temp\\test.txt
\"Hello!\"
Stop-Transcript

But PowerShe

7条回答
  •  粉色の甜心
    2021-02-05 05:39

    Tagging on to the amazing answer and work by @dwarfsoft:

    if ($Host.Name -match 'ISE' -and $Host.version.Major -lt 4)
    {
        #Start-Transcript will not work here. Use Start-iseTranscript by @dwarfsoft above
        Start-iseTranscript
    }
    else
    {
        #Start Transcript Will work here
        Start-Transcript
    }
    

提交回复
热议问题