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 locate the PowerShell modules:

$Found = Get-Module -Name $PowerShellModuleName -ListAvailable

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 PowerShell modules from the PSGallery: