...
Run the following commands to define the name of the PowerShell module or collection and the names of any prerequisite dependent modules in the collection:
Code Block |
---|
|
$Name$PowerShellModuleName = 'Microsoft.Graph'
$PrerequisiteModuleNames$DependentModuleNames = 'Microsoft.Graph.Authentication' |
...
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 } |
...