Versions Compared

Key

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

...

Run the following commands to define the name of the PowerShell module or collection and the name of any prerequisite dependent modules in the collection:

Code Block
languagepowershell
$Name$PowerShellModuleName = 'Az'
$PrerequisiteModuleNames$DependentModuleNames = 'Az.Accounts'

Run the following commands to define the Azure PowerShell modules respecting the dependency on the Az.Accounts module:

Code Block
languagepowershell
$Modules, $PrerequisiteModules$DependentModules = (Get-Module -Name "$Name$PowerShellModuleName.*").Where({$_.Name -notin $PrerequisiteModuleNames$DependentModuleNames},[System.Management.Automation.WhereOperatorSelectionMode]::Split)

...

Code Block
languagepowershell
$Modules | ForEach-Object { Remove-Module -Name $_.Name -Force }; $PrerequisiteModules$DependentModules | ForEach-Object { Remove-Module -Name $_.Name -Force }

...