Hi,
I’m trying to write some runtime monitoring and want to use “Get-PSUJob -Script” cmdlet. I’m getting some strange results which i can’t explain
I’ve written a hello-world script and scheduled the script to run each 5 minutes.
I can successfully get the script details using this cmdlet:
$psuScript = Get-PSUScript -Name “helloworld.ps1”
Then i want to query the jobs for that script:
$psuJob = Get-PSUJob -Script $($psuScript.Id)
In my case (test env) $psuScript.Id = 5
Inspecting $psuJob Get-PSUJob seems to have returned the (job)entry with id 5 instead of all the jobs for script.id 5
Just running Get-PSUJob returns all the jobs correctly.
And i can filter successfully with:
Get-PSUJob | Where-Object { $.Schedule -eq $thisPsuSchedule.Name -And $.ScriptFullPath -eq $psuScript.FullPath }
Am i using the -script logic correct? or did i hit a bug?
Thanks,
Z