I am looking for a way to check if a job is enabled before disabling it. I have found multiple posts using $Job.info.IsScheduleEnabled = "True", however I do not want to check the schedule, but the actual job. Is this possible. My mutt of a script is below.
$job = Get-VBRJob | Where-Object { $_.Name -eq $JobName }
# Check if the job is enabled
if (#CHECK IF JOB IS ENABLED) {
# Disable the job
Disable-VBRJob -Job $job
Write-Host "Job '$JobName' has been disabled."
} else {
Write-Host "Job '$JobName' is already disabled."