Hi,
After creating an instance of the latest Windows Server 2012 R2 image on Windows Azure, we see a strange issue with Powershell transcripts: Write-Host is not transcribed. However, "foobar" | Out-Host IS transcribed! Very strange. However, both Write-Warning, and any errors (exceptions, or write-error) does give output.
Anyone else seen this issue? Is this expected behavior or a bug?
Thanks a lot in advance! :-)
Sincerely,
Hallgeir
Here's my powershell version info:
PS C:\> $psversiontable Name Value ---- ----- PSVersion 4.0 WSManStackVersion 3.0 SerializationVersion 1.1.0.1 CLRVersion 4.0.30319.34014 BuildVersion 6.3.9600.17400 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0} PSRemotingProtocolVersion 2.2
Example:
********************** Windows PowerShell transcript start Start time: 20150114143638 Username: xxx\xxx RunAs User: xxx\xxx Machine: xxx (Microsoft Windows NT 6.3.9600.0) Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Process ID: 2160 ********************** Transcript started, output file is C:\foobar.txt PS C:\> Write-Host "This is a test" CurrentMatchIndex ReplacementIndex ReplacementLength CompletionMatches ----------------- ---------------- ----------------- ----------------- -1 0 12 {System.Management.Automat... PS C:\> Stop-Transcript ********************** Windows PowerShell transcript end End time: 20150114143658 **********************
Here's how it looks with piping to Out-Host:
********************** Windows PowerShell transcript start Start time: 20150114143755 Username: xxx\xxx RunAs User: xxx\xxx Machine: xxx (Microsoft Windows NT 6.3.9600.0) Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Process ID: 2160 ********************** Transcript started, output file is C:\foobar.txt CurrentMatchIndex ReplacementIndex ReplacementLength CompletionMatches ----------------- ---------------- ----------------- ----------------- -1 19 8 {System.Management.Automat... PS C:\> "This is a test" | Out-Host This is a test CurrentMatchIndex ReplacementIndex ReplacementLength CompletionMatches ----------------- ---------------- ----------------- ----------------- -1 0 9 {System.Management.Automat... PS C:\> Stop-Transcript ********************** Windows PowerShell transcript end End time: 20150114143809 **********************
- Edited by Hallgeirl Wednesday, January 14, 2015 2:42 PM