Public/Sync-AAD.ps1

function Sync-AAD {
    <#
    .SYNOPSIS
        Invoke a delta synchronization between on-premise Active Directory and Azure Active Directory.
    .EXAMPLE
        !sync
    #>

    [PoshBot.BotCommand(
        CommandName = 'syncaad',
        Aliases = ('sync', 'aad', 'sync-aad'),
        Permissions = 'invoke'
    )]
    [cmdletbinding()]
    param()

    $result = Invoke-Command -ComputerName "sun-aad.sunssc.local" -ScriptBlock {
        Start-ADSyncSyncCycle -PolicyType Delta
    }
    New-PoshBotCardResponse -Type Normal -Text ($result | format-list -property * | out-string) -Title "Sync Azure AD"
}