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, 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.
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.
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…
$PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 14393 206