...
Run the following commands to define the names of the Graph PowerShell module collection and of any modules that are a dependency for other modules the collection:
...
Run the following commands to split the Graph PowerShell module collection modules based upon any the module dependencies:
Code Block | ||
---|---|---|
| ||
$Modules, $DependencyModules = (Get-Module -Name "$PowerShellModuleName.*").Where({$_.Name -notin $DependsOnModuleNames},[System.Management.Automation.WhereOperatorSelectionMode]::Split) |
Run the following commands to unload the Graph PowerShell modules respecting any the module dependencies:
Code Block | ||
---|---|---|
| ||
$Modules | ForEach-Object { Remove-Module -Name $_.Name -Force }; $DependencyModules | ForEach-Object { Remove-Module -Name $_.Name -Force } |
...