diff --git a/Functions/Connect-M365CFV.ps1 b/Functions/Connect-M365CFV.ps1 index a6e345b..e956804 100644 --- a/Functions/Connect-M365CFV.ps1 +++ b/Functions/Connect-M365CFV.ps1 @@ -102,6 +102,13 @@ function Connect-M365CFV { } + if (Test-Path -Path "$env:USERPROFILE\.mg") { + + Remove-Item "$env:USERPROFILE\.mg" -Recurse -Force + Write-Host "Microsoft Graph cache has been cleared." -ForegroundColor Yellow + + } + if ($ConnectWithServicePrincipal) { Connect-MgGraph -AccessToken $graphTokenSecureString > $null