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 the modules:
Update-Module -Name $PowerShellModuleName
To install or reinstall the modules:
Save-Module -Path "$env:ProgramFiles\WindowsPowerShell\Modules" -Name $PowerShellModuleName -Force