Hi, I did the following:
$trigger = New-JobTrigger -Once -At ‘15:00 pm’
$cred = Get-Credential -UserName adminUser -Message “Enter password for given account”
Register-ScheduledJob -Name Test -FilePath d:\PS\DiskSpaceReport.ps1 -Trigger $trigger -Credential $cred
Scheduled job worked fine (I received email with DiskSpaceReport in a form of html report) but `Get-Job` returned:
Because of this `Receive-Job -id JobID` returns nothing. It should have returned messages that DiskSpaceReport.ps1 produces when run directly - not as job. I know that in case of scheduled jobs the results remain on disk after being received even without using -Keep parameter of Receive-Job. In my case I have no results alltogether. As soon as job was successfully completed HasMoreData was False.