Microsoft.Graph PowerShell Modules 2.26.0 released

Microsoft.Graph PowerShell Modules 2.26.0 released

Hi All,

A few Hors ago, Microsoft has released the Version 2.26.0 of Microsoft.Graph and Microsoft.Graph.Beta Modules.

Release Notes

  • Bumps versions for Azure.Identity, Azure.Identity.Broker and Microsoft.Graph.Core
  • feat: add direct dependency on System.Text.Json
  • Allow serialization of null valued properties
  • [v2] Examples Update
  • Re-enables generation of Get cmdlets for attack simulation
  • Drop unsupported net 6 and net 7
  • Updated examples for New-MgInvitaiton and New-MgBetaInvitation
  • Removes invalid path. /security/attackSimulation
  • Removes undocumented operations under /identityGovernance/privilegedAccess/group/assignmentSchedules/{privilegedAccessGroupAssignmentSchedule-id}
  • Removes unnecessary response content for PATCH operation that returns http status code 204
  • Removes undocumented path that returns http status code 404
  • Ensures that cmdlets are correctly mapped to their respective modules
  • Removes invalid path/teams/{team-id}/channels/{channel-id}/messages/$count
  • Updates module mapping file to add missing tag tenantRelationships.tenantRelationship.Functions
  • Updates module mapping file to add missing tag policies.deviceRegistrationPolicy
  • Updates module mapping file to add missing tag me.authentication
  • Removes undocumented patch operation for /sites/{site-id}/pages/{baseSitePage-id}
  • Updates default output for MicrosoftGraphDirectoryObject model properties
  • Adds -ObjectId parameter as an alias for -ApplicationId
  • Regenerate missing cmdlets
  • Removes invalid Remove-MgBetaEntitlementManagementAccessPackageAssignmentcmdlet

I am using the new PSResourceGet here instead of the PowerShellGet commands.

I’ve changed the Scope from “AllUsers” to “CurrentUser” in this Article - with that you don’t need to Run PowerShell as Administrator anymore.

Show installed Versions and what’s available in PowerShell Gallery

Get-InstalledPSResource Microsoft.Graph -Scope CurrentUser
Get-InstalledPSResource Microsoft.Graph.Beta -Scope CurrentUser
Find-PSResource Microsoft.Graph
Find-PSResource Microsoft.Graph.Beta

Uninstalling the old Microsoft.Graph Modules.

Get-InstalledPSResource Microsoft.Graph -Scope CurrentUser -ErrorAction SilentlyContinue | Uninstall-PSResource -Scope CurrentUser -SkipDependencyCheck

In the last few weeks i’ve noticed that uninstalling some Modules seems to have Problems. Might be it’s related to the CurrentUser Scope that is redirected to OneDrive. Anyone else seeing this?

I’ve updated the M365PSProfile PowerShell Module and the Uninstall-M365Module Function with the Parameter -FileMode. It will delete the Module Folder of that Module.

Install-PSResource -Name M365PSProfile -Scope CurrentUser
Import-Module M365PSProfile
Uninstall-M365Module -Modules Microsoft.Graph -Scope CurrentUser -FileMode
Uninstall-M365Module -Modules Microsoft.Graph.Beta -Scope CurrentUser -FileMode

Installing the New Microsoft.Graph Modules

Install-PSResource Microsoft.Graph -Scope CurrentUser -WarningAction SilentlyContinue
Install-PSResource Microsoft.Graph.Beta -Scope CurrentUser -WarningAction SilentlyContinue

List all the Modules

Get-PSResource Microsoft.Graph.* -Scope CurrentUser

Some basic testing

Connect-MgGraph -Scopes user.read.all -NoWelcome
Get-MgUser -UserId a.bohren@icewolf.ch
Disconnect-MgGraph

Works also fine with PowerShell 7.5

Connect-MgGraph -Scopes user.read.all -NoWelcome
Get-MgUser -UserId a.bohren@icewolf.ch
Disconnect-MgGraph

Or you can simply use my M365PSProfile Module - find the Documentation here: https://github.com/fabrisodotps1/M365PSProfile/

Install-PSResource -Name M365PSProfile
Add-M365PSProfile
Install-M365Module

Don’t forget to update the Microsoft.Graph Modules on Azure Automate

Regards
Andres Bohren

M365 Logo

PowerShell Logo