我是Powershell的新手,我試圖通過電子郵件發送輸出。如果我在Powershell中運行該腳本,它會給我提供正確的輸出,但電子郵件只會爲我提供SearchBase OU。 # The 60 is the number of days from today since the last logon
$xDays = (Get-Date).AddDays(-20)
# List of Se
如何從稱爲後臺作業的函數中獲取返回值? #Create the Status Background Job
Start-Job -Name "jobGetStatus" -InitializationScript $InitScript -ScriptBlock {$Status = GetStatus}
#Wait for job result
While (Get-Job -Name