I have some scripts that use Start-Transcript for logging. I have noticed that Write-Information statements are not output to the transcript log file when using the Integrated environment or PowerShell 7 (7.4.1). They also do not appear in the job log.
Using PowerShell 5.1 the Write-Information statements do appear in the log file, but not the job log.
To reproduce:
Create a script:
Start-Transcript -Path D:\Temp\transcript.txt -Append
Write-Information 'Write-Information'
Write-Host 'Write-Host'
Write-Warning 'Write-Warning'
Write-Output 'Write-Output'
Stop-Transcript
In the script settings, set the Environment to Integrated or PowerShell 7.
Run the script.
Expected behaviour:
Transcript (transcript.txt) will contain:
INFO: Write-Information
Write-Host
WARNING: Write-Warning
Write-Output
Actual behaviour:
Transcript (transcript.txt) contains:
Write-Host
WARNING: Write-Warning
Write-Output
Product: PowerShell Universal
Version: 4.2.5