Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(maint) Change winrm specs to write to stdout
- The current WinRM specs use the Write-Output cmdlet. The Write-Output cmdlet is designed for writing objects to the PowerShell pipeline, *not* for writing stdout to a host. PowerShell has a few different methods of writing more directly to stdout, the most popular of which is Write-Host. Write-Host is typically frowned upon by the PowerShell community, but because it is not appropriate for use where pipelines may be involved: http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ When the goal is to emit text to be consumed by other tooling that doesn't integrate with the PowerShell pipeline, Write-Host becomes an important tool, and likely the case the tests are interested in (independent ordered text-based writes to stdout). Such counterpoints are provided at: https://psitem.com/2015/01/16/is-write-host-really-harmful/ The other alternatives to calling Write-Host are Out-Host, [Console]::WriteLine and the lesser known $Host.UI.WriteLine - While Write-Output can generate output for both stdout *and* for the PowerShell pipeline, there is also a problem with using it if output ordering is important. In PowerShell 5, changes were introduced to its behavior, so that implicit table formatting receives a 300ms delay. This often results in out-of-order output when Write-Output is used, and may especially be the case when pipeline writes with Write-Output are mixed with direct writes to stdout with Write-Host PowerShell/PowerShell#4594 https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/14925213-bug-console-output-appears-out-of-order
- Loading branch information