Repository: microsoft/CSS-Exchange
File: Calendar/Get-RBASummary.ps1 (PowerShell)

Code before:
        Lastly if the Request is accepted, the PostProcessing steps will be performed.
"@
}

function RBACriteria {
    Write-Host "`r`n===================="
    Write-Host "Policy Configuration";
    Write-Host "====================`r`n";

    Write-Host " The following criteria are used to determine if a meeting request is in-policy or out-of-policy. ";
    Write-Host -ForegroundColor Cyan "`t Setting                          Value"
    Write-Host -ForegroundColor Cyan "`t -------------------------------  -----------------------------"
    Write-Host -ForegroundColor Cyan "`t AllowConflicts:                 "$RbaSettings.AllowConflicts
    Write-Host -ForegroundColor Cyan "`t AllowDistributionGroup:         "$RbaSettings.AllowDistributionGroup
    Write-Host -ForegroundColor Cyan "`t AllowMultipleResources:         "$RbaSettings.AllowMultipleResources
    Write-Host -ForegroundColor Cyan "`t MaximumDurationInMinutes:       "$RbaSettings.MaximumDurationInMinutes
    Write-Host -ForegroundColor Cyan "`t MinimumDurationInMinutes:       "$RbaSettings.MinimumDurationInMinutes
    Write-Host -ForegroundColor Cyan "`t AllowRecurringMeetings:         "$RbaSettings.AllowRecurringMeetings
    Write-Host -ForegroundColor Cyan "`t ScheduleOnlyDuringWorkHours:    "$RbaSettings.ScheduleOnlyDuringWorkHours
    Write-Host -ForegroundColor Cyan "`t ProcessExternalMeetingMessages: "$RbaSettings.ProcessExternalMeetingMessages
    Write-Host -ForegroundColor Cyan "`t BookingWindowInDays:            "$RbaSettings.BookingWindowInDays
    Write-Host -ForegroundColor Cyan "`t ConflictPercentageAllowed:      "$RbaSettings.ConflictPercentageAllowed
    Write-Host -ForegroundColor Cyan "`t MaximumConflictInstances:       "$RbaSettings.MaximumConflictInstances
    Write-Host -ForegroundColor Cyan "`t MaximumConflictPercentage:      "$RbaSettings.MaximumConflictPercentage
    Write-Host -ForegroundColor Cyan "`t EnforceSchedulingHorizon:       "$RbaSettings.EnforceSchedulingHorizon
    Write-Host -ForegroundColor Cyan "`t SchedulingHorizonInDays:        "$RbaSettings.SchedulingHorizonInDays

    Write-Host -NoNewline "`r`nIf all the above criteria are met, the request is "
    Write-Host -ForegroundColor Yellow -NoNewline "In-Policy."
    Write-Host -NoNewline "`r`nIf any of the above criteria are not met, the request is "
    Write-Host -ForegroundColor DarkYellow -NoNewline  "Out-of-Policy.";
    Write-Host;
}

# RBA processing settings Verbose Output
function RBACriteriaExtra {
    if ($PSBoundParameters['Verbose']) {

        $RBACriteriaExtra = ""

        if ($RbaSettings.AllowConflicts -eq $true) {
            $RBACriteriaExtra += "Unlimited conflicts are allowed. This is Required for Workspaces.`r`n"
        } elseif ($RbaSettings.ConflictPercentageAllowed -eq 0 `
                -and $RbaSettings.MaximumConflictInstances -eq 0) {
            $RBACriteriaExtra += "No conflicts are allowed.`r`n"
        } else {
            $RBACriteriaExtra += "For Recurring meetings, conflicts are allowed as long as they are less than $($RbaSettings.ConflictPercentageAllowed)% or less than $($RbaSettings.MaximumConflictInstances) instances.`r`n"
        }

        if ($RbaSettings.AllowDistributionGroup -eq $true) {
            $RBACriteriaExtra += "Distribution groups are allowed.`r`n"

Review comment (suggestion):
Don't like this format. We could change this up a bit, you can create a function that handles this based off an object that you created, it would make it cleaner to read. If that is something you want to do and don't know how let me know. 

Code after:
        Lastly if the Request is accepted, the PostProcessing steps will be performed.
"@
}

function RBACriteria {
    Write-Host "`r`n===================="
    Write-Host "Policy Configuration";
    Write-Host "====================`r`n";

    Write-Host " The following criteria are used to determine if a meeting request is in-policy or out-of-policy. ";
    Write-Host -ForegroundColor Cyan @"
    `t Setting                          Value
    `t ------------------------------  -----------------------------
    `t AllowConflicts:                 $($RbaSettings.AllowConflicts)
    `t AllowDistributionGroup:         $($RbaSettings.AllowDistributionGroup)
    `t AllowMultipleResources:         $($RbaSettings.AllowMultipleResources)
    `t MaximumDurationInMinutes:       $($RbaSettings.MaximumDurationInMinutes)
    `t MinimumDurationInMinutes:       $($RbaSettings.MinimumDurationInMinutes)
    `t AllowRecurringMeetings:         $($RbaSettings.AllowRecurringMeetings)
    `t ScheduleOnlyDuringWorkHours:    $($RbaSettings.ScheduleOnlyDuringWorkHours)
    `t ProcessExternalMeetingMessages: $($RbaSettings.ProcessExternalMeetingMessages)
    `t BookingWindowInDays:            $($RbaSettings.BookingWindowInDays)
    `t ConflictPercentageAllowed:      $($RbaSettings.ConflictPercentageAllowed)
    `t MaximumConflictInstances:       $($RbaSettings.MaximumConflictInstances)
    `t MaximumConflictPercentage:      $($RbaSettings.MaximumConflictPercentage)
    `t EnforceSchedulingHorizon:       $($RbaSettings.EnforceSchedulingHorizon)
    `t SchedulingHorizonInDays:        $($RbaSettings.SchedulingHorizonInDays)
"@;
    Write-Host -NoNewline "`r`nIf all the above criteria are met, the request is "
    Write-Host -ForegroundColor Yellow -NoNewline "In-Policy."
    Write-Host -NoNewline "`r`nIf any of the above criteria are not met, the request is "
    Write-Host -ForegroundColor DarkYellow -NoNewline  "Out-of-Policy.";
    Write-Host;

    # RBA processing settings Verbose Output
    $RBACriteriaExtra = ""

    if ($RbaSettings.AllowConflicts -eq $true) {
        $RBACriteriaExtra += "Unlimited conflicts are allowed. This is Required for Workspaces.`r`n"
    } elseif ($RbaSettings.ConflictPercentageAllowed -eq 0 `
            -and $RbaSettings.MaximumConflictInstances -eq 0) {
        $RBACriteriaExtra += "No conflicts are allowed.`r`n"
    } else {
        $RBACriteriaExtra += "For Recurring meetings, conflicts are allowed as long as they are less than $($RbaSettings.ConflictPercentageAllowed)% or less than $($RbaSettings.MaximumConflictInstances) instances.`r`n"
    }

    if ($RbaSettings.AllowDistributionGroup -eq $true) {
        $RBACriteriaExtra += "Distribution groups are allowed.`r`n"
    } else {
        $RBACriteriaExtra += "Distribution groups are not allowed.`r`n"
    }