我在 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"
為什么在底部的日志中可以看到“PowerShell timer trigger function ran!”?
uj5u.com熱心網友回復:
感謝@Dilly B,我已經在我的環境中重現并得到如下預期結果:
首先,我使用Write-Host 了 Ouput 并顯示在輸出螢屏中,如下所示:

然后我使用Write-Output并獲得了如下日志:

日志中的輸出:

編輯:



轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/534705.html
標籤:电源外壳天蓝色函数
