Versions Compared

Key

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

...

Run the following commands to define the name names of the PowerShell module or collection and the names of any dependent modules in modules that are a dependency for other modules the collection:

Code Block
languagepowershell
$PowerShellModuleName = 'Microsoft.Graph'
$DependentModuleNames$DependsOnModuleNames = 'Microsoft.Graph.Authentication'

Run the following commands to define split the Graph PowerShell modules respecting the dependency on the Microsoft.Graph.Authentication modulemodule collection based upon any dependencies:

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

Run the following commands to unload the Graph PowerShell modules respecting the dependency on the Microsoft.Graph.Authentication moduleany dependencies:

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

...