def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") in [6, 8],
            any(
                [
                    "Cmdlet failed. Cmdlet Get-App, " in event.deep_get("Data", default=""),
                    "Task Get-App throwing unhandled exception: System.InvalidCastException:"
                    in event.deep_get("Data", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
