Output stream stops going to console in ISE

This topic contains 8 replies, has 5 voices, and was last updated by Profile photo of Frank DeGraner Frank DeGraner 6 months, 1 week ago.

  • Author
    Posts
  • #27771
    Profile photo of Joel Newton
    Joel Newton
    Participant

    Hi,

    I'm finding that, after working for a while in an ISE session, the contents of the output stream stop appearing in the output pane. No errors – just no output. "Write-Output 'test' " produces a blank line. How would I find out if some command / something I've executed has hijacked my output stream, and reset it to appear in the output pane?

    Thanks,
    Joel

  • #27772
    Profile photo of i255d
    i255d
    Participant

    I am sure you have tried other commands too right?

    I would try:

     Write-Output "test" > C:\test\test.txt

    or this:

    Write-Host "test" -ForegroundColor Green

    See if you get anything in the txt file.
    By the way, the file doesn't have to exist, but the folder does.

  • #27773
    Profile photo of Joel Newton
    Joel Newton
    Participant

    Thanks, i255d. Redirecting Write-Output to a file does result in the output correctly showing up in the file. Write-Host hasn't stopped working – Write-Error and Write-Warning work as well. It's just Write-Output content that doesn't appear and anything that uses that stream.

    For example, Get-Help Invoke-Command returns an empty line.

    Cheers,
    Joel

  • #27806
    Profile photo of Joel Newton
    Joel Newton
    Participant

    Anyone seen this behavior at all?
    It's very disruptive to my coding and I'd like to get it resolved.
    thanks.

  • #28144
    Profile photo of Kwyjibo
    Kwyjibo
    Participant

    I've seen this issue myself in recent weeks, on multiple machines. I may have narrowed it down, by chance are you using the PowerShell Transcription GPO? I turned it off on one of my machines, and the problem went away... I turned transcription back on last Friday, and the issue is back today.

  • #28246
    Profile photo of Joel Newton
    Joel Newton
    Participant

    Hi, Kwyjibo,

    I'm not familiar with the Transcript GPO. I do make regular use of PS transcripts, though.

    Thanks,
    Joel

  • #44296

    Anybody have the solution for this ?
    Im having the same problem, Im using PowerShell ISE on Windows Server 2012 R2.

  • #44354
    Profile photo of Joel Newton
    Joel Newton
    Participant

    No solution, yet, but a possible lead: it seems to happen most consistently in conjunction with executing a script that does a chef-client run from the command line. Like somehow that chef-client run hijacks the console output, so it's going somewhere other than the ISE.

  • #58417
    Profile photo of Frank DeGraner
    Frank DeGraner
    Participant

    I've got the same problem. I thought it might be a scope issue because I was testing on a Hyper-V host over RDP. And the script is stored on a file share. So I got on the console of the server (Server 2016), copied the script to the Desktop. Same results. I'm running the ISE as Administrator because I need to manipulate VMs.

    The function in question is getting the correct values but I can't retrieve and Write-Output/Write-Host the values from outside function... I've tried 'Return $myvalue' and 'Set-Variable -Name myvalue -Value 'somevalue' -Scope Global' ... same results...

    $PSVersionTable.PSVersion
    
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    5      1      14393  206 

You must be logged in to reply to this topic.