PowerShell 7.3 - implementing Scheduled Jobs Not Executing as Expected on Remote Machines
I've tried everything I can think of but I'm building a feature where I'm writing unit tests and I've hit a wall trying to I'm working with problems with scheduled jobs in PowerShell 7.3 when trying to execute them on remote machines... I've set up a scheduled job using `Register-ScheduledJob`, and while it seems to work fine on my local machine, it fails to run on the remote systems. The behavior message I see in the job history for the remote run is: ``` Start-Job : Unable to start job. Job did not run on 'RemoteMachineName'. ``` I've ensured that the remote machine has the necessary permissions and that the `WinRM` service is running. Here's the code I've used to create the scheduled job: ```powershell $scriptBlock = { Get-Process | Where-Object { $_.CPU -gt 100 } | Export-Csv -Path 'C:\HighCpuProcesses.csv' -NoTypeInformation } Register-ScheduledJob -Name 'HighCpuJob' -ScriptBlock $scriptBlock -Trigger (New-JobTrigger -At 2am -Daily) -ScheduledJobOption (New-ScheduledJobOption -StartIfOnBatteries -AllowStartIfGoingOnBatteries) ``` I've tried running the job manually using `Start-Job`, and it works fine, but the scheduled job just won't trigger at the designated time on the remote machine. Additionally, I checked the Windows Task Scheduler on the remote machine, and there is no entry for the job, which makes me think itβs not being registered properly. I've also ensured that the network and firewall settings allow for remote management. Could there be any specific configurations or parameters I might be missing when registering the scheduled job for remote execution? Any insights on troubleshooting this scenario would be greatly appreciated. I'd really appreciate any guidance on this. Any examples would be super helpful. This is my first time working with Powershell stable. Could someone point me to the right documentation? I recently upgraded to Powershell 3.11.