I have the simple script in run.ps1
# Input bindings are passed in via param block.
param($Timer)
# Get the current universal time in the default string format.
$currentUTCtime = (Get-Date).ToUniversalTime()
# The 'IsPastDue' property is 'true' when the current function invocation is later than scheduled.
if ($Timer.IsPastDue) {
Write-Host "PowerShell timer is running late!"
}
# Write an information log with the current time.
Write-host "PowerShell timer trigger function ran!"
Write-Debug "PowerShell timer trigger function ran! TIME: $currentUTCtime"
Why can I see ""PowerShell timer trigger function ran!" in the log on the bottom?
CodePudding user response:
Thanks @Dilly B, I have reproduced in my environment and got expected results as below:
Firstly, I have used Write-Host
and Ouput is displayed in Output Screen as below:
Then I have used Write-Output
and got logs of it as below:
Output in logs:
Edit: