Does Azure Automation support Write-Information?
If you want to write info logs into Azure Automation job logs, I suggest you use write-output
. For details, you can refer to this article.
I'm not sure if write-information
is supported or not in runbook
. I test it at my side, as well as I test the cmdlet write-host
which is a wrapper for write-information
. But no message output for both of them.
A support ticket is raised for confirmation from MS.
Hope this helps.
Azure Automation does not fully support the Information stream at this point. PowerShell 5 support is not enough: your runbook will not fail, but Automation will not capture and store the Information stream content, and this is why you will not see it in the logs.
I do wish Write-Information was available in Azure Automation.
Using Write-Output in a function that you want to return something else (like a Boolean) is quite problematic.