...
Code Block |
---|
|
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted |
Modify then run Run the following commands to define locate the name of the loaded PowerShell modulemodules:
Code Block |
---|
|
If ([string]::IsNullOrEmpty($PowerShellModuleName)) { $PowerShellModuleName = 'ExchangeOnlineManagement' }$Loaded = Get-Module -Name $PowerShellModuleName |
Run the following commands to locate the installed PowerShell modules :
Code Block |
---|
|
$Found$Installed = Get-Module -Name $PowerShellModuleName -ListAvailable |
...
Code Block |
---|
|
If ($Loaded) { Remove-Module -Name $PowerShellModuleName -Force } |
Run the code blocks in one of the following sections following commands to update or install the latest version of the PowerShell modules from the PSGallery:
To install the module:
...
If ($Installed) { Update-Module -Name $PowerShellModuleName |
...
To update the module:
...
...
} Else { Install-Module -Name $PowerShellModuleName } |