Versions Compared

Key

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

...

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'

...

Run the following commands to locate any installed instance of the loaded PowerShell modules: module

Code Block
languagepowershell
$Loaded$ModuleIsInstalled = Get-Module -Name $PowerShellModuleName -ListAvailable

Run the following commands to locate any active instance of the installed PowerShell modules module:

Code Block
languagepowershell
$Installed$ModuleIsActive = Get-Module -Name $PowerShellModuleName -ListAvailable

Run the following commands to unload any active instance of the PowerShell modulesmodule

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

Run the following commands to update or install the latest version of the PowerShell modules module from the PSGallery: 

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