Updated parameter names and help messages to replace Azure AD with Entra ID in param block.
Renamed log messages to reflect Entra ID instead of Azure AD in various functions.
Authentication and Module Updates:
Replaced Get-AuthToken function with Test-GraphSession to check for Microsoft Graph PowerShell SDK instead of Azure AD module, verify that the user has authenticated, and verify that the required script permissions are present in the current session.
Removed old AzureAD module checks and related authentication code.
Updated to only check for Microsoft.Graph.Authentication module, since this script uses manual Graph calls.
API Call Updates:
Replaced all Invoke-RestMethod calls with Invoke-MgGraphRequest for making API requests to Microsoft Graph.
Fixed Get-AppInstallStatuses to use the updated API endpoints for retrieving user/device app install status.
Removed function and references to Get-WindowsProtectionSummary (WIP deprecation).
Code Simplification:
Removed redundant Has-UserStatus function and refactored Get-AppInstallStatuses to streamline app status retrieval.
Removed redundant UserName parameter since the Graph session and authorized scopes are validated during script runtime.
Renaming for Entra ID:
Authentication and Module Updates:
Get-AuthToken
function withTest-GraphSession
to check for Microsoft Graph PowerShell SDK instead of Azure AD module, verify that the user has authenticated, and verify that the required script permissions are present in the current session.API Call Updates:
Invoke-RestMethod
calls withInvoke-MgGraphRequest
for making API requests to Microsoft Graph.Get-AppInstallStatuses
to use the updated API endpoints for retrieving user/device app install status.Get-WindowsProtectionSummary
(WIP deprecation).Code Simplification:
Has-UserStatus
function and refactoredGet-AppInstallStatuses
to streamline app status retrieval.UserName
parameter since the Graph session and authorized scopes are validated during script runtime.