Microsoft365.Toolbox.psm1

#Requires -Modules MSOnline

#Get public and private function files
    $Public  = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
    $Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )

#Import source the files.
Foreach($import in @($Public + $Private)) {
    try {
       . $import.fullname
    }
    catch {
        Write-Error -Message "Failed to import function $($import.fullname): $_"
    }
}