Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prerequisites

The PowerShellModuleName variable must already be defined or one of the following values must be set:

Expand
titleCommon PowerShell module names
Info

Exchange Online

Code Block
languagepowershell
$PowerShellModuleName = 'ExchangeOnlineManagement'

Install the PowerShell module

Run the following commands to verify the NuGet provider is installed:

...

Run the following commands to locate the loaded active PowerShell modules:

Code Block
languagepowershell
$Loaded$ModuleIsActive = Get-Module -Name $PowerShellModuleName

Run the following commands to locate the installed PowerShell modules

Code Block
$Installed$ModuleIsInstalled = Get-Module -Name $PowerShellModuleName -ListAvailable

...

Code Block
languagepowershell
If ($Loaded$ModuleIsActive) { Remove-Module -Name $PowerShellModuleName -Force }

...

Code Block
languagepowershell
If ($Installed$ModuleIsInstalled) { Update-Module -Name $PowerShellModuleName } Else { Install-Module -Name $PowerShellModuleName }

...