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?
I am sure you have tried other commands too right?
I would try:
Write-Output "test" > C:\test\test.txt
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.
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.
Anyone seen this behavior at all?
It’s very disruptive to my coding and I’d like to get it resolved.
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.
I’m not familiar with the Transcript GPO. I do make regular use of PS transcripts, though.
Anybody have the solution for this ?
Im having the same problem, Im using PowerShell ISE on Windows Server 2012 R2.
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.
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…
Major Minor Build Revision
----- ----- ----- --------
5 1 14393 206