test-msGraphVersions.ps1

function test-msGraphVersions
{
    out-logfile -string "Enterring test-msGraphVersions"

    $msGraphModuleName = "Microsoft.Graph.Authentication"
    $telmetryHelpderModuleName = "TelemetryHelper"

    out-logfile -string "Proactively updating all installed graph powershell moddules."

    update-powershellModule -powershellModuleName $msGraphModuleName
    update-powershellModule -powershellModuleName $telmetryHelpderModuleName

    $installedVersion = Test-PowershellModule -powershellModuleName $msGraphModuleName -getInstalledVersion $TRUE
    $galleryVersion = Test-PowershellModule -powershellModuleName $msGraphModuleName -getInstalledVersion $FALSE

    if ($galleryVersion -ne $installedVersion)
    {
        out-logfile -string "The installed version of the Microsoft.Graph.Authentication module is not the same as the gallery version."
        out-logfile -string ("Installed Version: "+$installedVersion)
        out-logfile -string ("Gallery Version: "+$galleryVersion)
        out-logfile -string "Updating to the latest version of the graph authentication module."
    }
    else
    {
        out-logfile -string "The installed version of the Microsoft.Graph.Authentication module is the same as the gallery version."
        out-logfile -string ("Installed Version: "+$installedVersion)
        out-logfile -string ("Gallery Version: "+$galleryVersion)
    }
}