...
The PowerShellModuleName variable must already be defined or one of the following values must be set:
| Expand |
|---|
| title | Common PowerShell module names |
|---|
|
| Code Block |
|---|
| $PowerShellModuleName = 'ExchangeOnlineManagement' |
|
...
Run the following commands to locate any installed instance of the loaded PowerShell modules: module
| Code Block |
|---|
|
$Loaded$ModuleIsInstalled = Get-Module -Name $PowerShellModuleName -ListAvailable |
Run the following commands to locate any active instance of the installed PowerShell modules module:
| Code Block |
|---|
|
$Installed$ModuleIsActive = Get-Module -Name $PowerShellModuleName -ListAvailable |
Run the following commands to unload any active instance of the PowerShell modulesmodule
| Code Block |
|---|
|
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 |
|---|
|
If ($Installed$ModuleIsInstalled) { Update-Module -Name $PowerShellModuleName -Verbose } Else { Install-Module -Name $PowerShellModuleName -Verbose } |