Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Run the following commands to verify the NuGet provider is installed:

Find-PackageProvider -Name NuGet -Force -ForceBootstrap

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

$PowerShellModuleName = 'Microsoft.Graph'
$DependentModuleNames = 'Microsoft.Graph.Authentication'

Run the following commands to define the Graph PowerShell modules respecting the dependency on the Microsoft.Graph.Authentication module:

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

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

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

Run the code blocks in one of the following sections to update or install the latest version of the Graph PowerShell modules from the PSGallery: 

  • To update the modules:

    Get-Module -ListAvailable -Name "$Name.*" | ForEach-Object { Update-Module -Name $_.Name } 
  • To install or reinstall the modules:

    Save-Module -Path "$env:ProgramFiles\WindowsPowerShell\Modules" -Name $Name -Force

  • No labels