Private/Format-RawAlerts.ps1

function Format-RawAlerts {
    [CmdletBinding()]
    param (
        $Alerts,
        $VpgLookup
    )

    $Output = foreach ($Alert in $Alerts) {
        $AffectedVpgs = foreach ($Vpg in $Alert.AffectedVpgs) {
            $VpgLookup.$($Vpg.identifier)
        }
        $Obj = [PSCustomObject] @{
            AffectedVpgs = $AffectedVpgs
            Description = $Alert.Description
            Entity = $Alert.Entity
            HelpIdentifier = $Alert.HelpIdentifier
            IsDismissed = $Alert.IsDismissed
            Level = $Alert.Level
            AlertId = $Alert.Link.identifier
            TurnedOn = $Alert.TurnedOn
        }
        $Obj.PSObject.TypeNames.Insert(0, "ZertoPS.Alert")
        $Obj
    }
    $Output
}