Run the following commands to verify the NuGet provider is installed:
Find-PackageProvider -Name 'NuGet' -Force -ForceBootstrap
Modify then run the following commands to define the name of the PowerShell module:
$PowerShellModuleName = 'ExchangeOnlineManagement'
Run the following commands to unload the PowerShell modules
Remove-Module -Name $PowerShellModuleName -Force
Run the code blocks in one of the following sections to update or install the latest version of the Graph PowerShell modules from the PSGallery:
To update or install the module:
Update-Module -Name $PowerShellModuleName