Functions/HealthCheck/Conditions/Get-AMHCScheduleInvalidLaunchDate.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Get-AMHCScheduleInvalidLaunchDate {
    <#
        .SYNOPSIS
            Invalid Schedule Launch Dates
 
        .DESCRIPTION
            Schedules that have not computed a next launch date
 
        .PARAMETER Conditions
            The conditions to perform health check against
    #>

    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [AllowNull()]
        $Conditions
    )

    foreach ($condition in ($Conditions | Where-Object {$_.TriggerType -eq "Schedule" -and $_.NextLaunchDate -eq ''})) {
        [AMConstructHealthCheckItem]::New($condition, "Next Launch Date not set")
    }
}