-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathInstalling_Microsoft_Graph_PowerShell_SDK.ps1
More file actions
30 lines (20 loc) · 1.19 KB
/
Installing_Microsoft_Graph_PowerShell_SDK.ps1
File metadata and controls
30 lines (20 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#Set the Execution Policy (Windows)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
#Installing the Module
#Installing the Graph PowerShell module with no previous versions installed
Install-module Microsoft.Graph
#If upgrading from a preview modules, run install-module with AllowClobber and Force parameter to avoid command name conflicts
Install-Module Microsoft.Graph -AllowClobber -Force -Verbose
#Updating from an earlier version of MS Graph PowerShell installed from PS Gallery
Update-module Microsoft.Graph
#Uninstalling the old preview version, before installing the new
#Remove the main meta module
Uninstall-Module Microsoft.Graph
#Remove all the dependent modules
Get-InstalledModule Microsoft.Graph.* | ForEach-Object { if($_.Name -ne "Microsoft.Graph.Authentication"){ Uninstall-Module $_.Name } }
#Update the authentication module
Install-Module Microsoft.Graph.Authentication -Repository PSGallery -force
#Or uninstall the authentication module
Uninstall-Module Microsoft.Graph.Authentication
#The Modules are installed in the user profile
' "$env:USERPROFILE\Documents\PowerShell\Modules" or "C:\Users\admin\Documents\PowerShell\Modules" '