...
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 |
---|
|
$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 |
---|
|
$Modules, $PrerequisiteModules$DependentModules = (Get-Module -Name "$Name$PowerShellModuleName.*").Where({$_.Name -notin $PrerequisiteModuleNames$DependentModuleNames},[System.Management.Automation.WhereOperatorSelectionMode]::Split) |
...
Code Block |
---|
|
$Modules | ForEach-Object { Remove-Module -Name $_.Name -Force }; $PrerequisiteModules$DependentModules | ForEach-Object { Remove-Module -Name $_.Name -Force } |
...