chore: removed testing functions

This commit is contained in:
2025-08-17 21:24:55 +10:00
parent fb78e68a6d
commit 6921651d11

View File

@ -68,6 +68,14 @@ function Get-OrCreateCountryNamedLocations {
return $namedLocationIds return $namedLocationIds
} }
# Ensure Microsoft Graph modules are installed
foreach ($module in @("Microsoft.Graph", "Microsoft.Graph.Beta", "ExchangeOnlineManagement")) {
if (-not (Get-Module -ListAvailable -Name $module)) {
Install-Module -Name $module -Scope CurrentUser -Force
}
}
Write-Host "🔐 Connecting to MS Graph Online..."
Connect-MgGraph -NoWelcome -Scopes ` Connect-MgGraph -NoWelcome -Scopes `
"Policy.ReadWrite.SecurityDefaults", ` "Policy.ReadWrite.SecurityDefaults", `
"Policy.ReadWrite.ConditionalAccess", ` "Policy.ReadWrite.ConditionalAccess", `
@ -75,8 +83,8 @@ Connect-MgGraph -NoWelcome -Scopes `
"Group.ReadWrite.All", ` "Group.ReadWrite.All", `
"Directory.ReadWrite.All", ` "Directory.ReadWrite.All", `
"UserAuthenticationMethod.ReadWrite.All", ` "UserAuthenticationMethod.ReadWrite.All", `
"Application.ReadWrite.All" "Application.ReadWrite.All", `
"SecurityEvents.ReadWrite.All"
Write-Host "Connected to Microsoft Graph" Write-Host "Connected to Microsoft Graph"
@ -263,3 +271,4 @@ foreach ($u in $users) {
} }