chore: update ImportPolicies.ps1 to install SDK if not found

This commit is contained in:
2025-03-06 13:12:13 +10:00
parent de1b3db83c
commit 748939b404

View File

@ -1,3 +1,14 @@
# Check if the Microsoft Graph PowerShell SDK is installed
if (-not (Get-Module -ListAvailable -Name Microsoft.Graph)) {
Install-Module -Name Microsoft.Graph -Scope CurrentUser -Force
}
# Check if the Microsoft Graph PowerShell SDK is installed
if (-not (Get-Module -ListAvailable -Name Microsoft.Graph.Beta)) {
Install-Module -Name Microsoft.Graph.Beta -Scope CurrentUser -Force
}
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "DeviceManagementConfiguration.ReadWrite.All", "Organization.Read.All", "Group.ReadWrite.All", "Directory.ReadWrite.All" -NoWelcome