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

Code before:
        if (CheckForNoPIIAccess($script:GetMailboxOutput.DisplayName)) {
            Write-Host -ForegroundColor Magenta "No PII Access for [$Identity]"
        } else {
            Write-Verbose "Found [$($GetMailboxOutput.DisplayName)]"
        }
        return $GetMailboxOutput
    } catch {
        Write-Error "An error occurred while running Get-Mailbox: [$_]"
    }
}

<#
.SYNOPSIS
Checks if a set of Calendar Logs is from the Organizer.
#>
function SetIsOrganizer {
    param(
        $CalLogs
    )
    $IsOrganizer = $false

    foreach ($CalLog in $CalLogs) {
        if ($CalendarItemTypes.($CalLog.ItemClass) -eq "IpmAppointment" -and
            $CalLog.ExternalSharingMasterId -eq "NotFound" -and
            ($CalLog.ResponseType -eq "1" -or $CalLogs.ResponseType -eq "Organizer")) {
            $IsOrganizer = "True"
            Write-Verbose "IsOrganizer: [$IsOrganizer]"
            return $IsOrganizer
        }
    }
    Write-Verbose "IsOrganizer: [$IsOrganizer]"
    return $IsOrganizer
}

function SetIsRoom {
    param(
        $CalLogs
    )
    $IsRoom = $false
    # Simple logic is if RBA is running on the MB, it is a Room MB, otherwise it is not.
    foreach ($CalLog in $CalLogs) {
        if ($CalendarItemTypes.($CalLog.ItemClass) -eq "IpmAppointment" -and
            $CalLog.ExternalSharingMasterId -eq "NotFound" -and
            $CalLog.Client -eq "ResourceBookingAssistant" ) {
            $IsRoom = "True"
            return $IsRoom
        }
    }
    return $IsRoom
}


Review comment (suggestion):
This should be a boolean of `$true`, not a string if we are originally setting `$IsOrganizer = $false` 

Code after:
                Write-Verbose "Found GroupMailbox [$($GetMailboxOutput.DisplayName)]"
            }
        } else {
            Write-Verbose "Found [$($GetMailboxOutput.DisplayName)]"
        }

        if (CheckForNoPIIAccess($script:GetMailboxOutput.DisplayName)) {
            Write-Host -ForegroundColor Magenta "No PII Access for [$Identity]"
        } else {
            Write-Verbose "Found [$($GetMailboxOutput.DisplayName)]"
        }
        return $GetMailboxOutput
    } catch {
        Write-Error "An error occurred while running Get-Mailbox: [$_]"
    }
}

<#
.SYNOPSIS
Checks if a set of Calendar Logs is from the Organizer.
#>
function SetIsOrganizer {
    param(
        $CalLogs
    )
    [bool] $IsOrganizer = $false

    foreach ($CalLog in $CalLogs) {
        if ($CalendarItemTypes.($CalLog.ItemClass) -eq "IpmAppointment" -and
            $CalLog.ExternalSharingMasterId -eq "NotFound" -and
            ($CalLog.ResponseType -eq "1" -or $CalLogs.ResponseType -eq "Organizer")) {
            $IsOrganizer = $true
            Write-Verbose "IsOrganizer: [$IsOrganizer]"
            return $IsOrganizer
        }
    }
    Write-Verbose "IsOrganizer: [$IsOrganizer]"
    return $IsOrganizer
}

function SetIsRoom {
    param(
        $CalLogs
    )
    [bool] $IsRoom = $false
    # Simple logic is if RBA is running on the MB, it is a Room MB, otherwise it is not.
    foreach ($CalLog in $CalLogs) {
        if ($CalendarItemTypes.($CalLog.ItemClass) -eq "IpmAppointment" -and
            $CalLog.ExternalSharingMasterId -eq "NotFound" -and
            $CalLog.Client -eq "ResourceBookingAssistant" ) {
            $IsRoom = $true