Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Install SharePointPnPPowerShellOnline, PowerShell 5.0 and Nuget behind proxy

Velin Georgiev edited this page May 10, 2017 · 1 revision

Install Windows Management Framework 5.0 (WMF)

Go to the Microsoft Download center, download Windows Management Framework 5.0 and install it. The installation requires reboot of the PC. After the reboot open the PowerShell command shell window as administrator and verify the version of the installed PowerShell.

$PSVersionTable.PSVersion

The output should be similar to what is shown below:

Major  Minor  Build  Revision
-----  -----  -----  --------
5      0      10586  117 

Set up proxy credentials

$wc = New-Object System.Net.WebClient
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

Install the Nuget package provider

Check if nuget is available in the package providers by running the following command.

Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, InstallUpdate, PackageManagementPr...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

If the above output is the case and nuget is not presented, it has to be installed.

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

Here is successful installation output:

Name                           Version          Source                         Summary
----                           -------          ------                         -------
nuget                          2.8.5.208        https://oneget.org/nuget-2.... NuGet provider for the OneGet meta-pa...

Register the default repository for PowerShell modules

Register default repository if none available:

Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted

Install the SharePointPnPPowerShellOnline module

Install-Module SharePointPnPPowerShellOnline

if error 'UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand' appears when running the SharePointPnPPowerShellOnline module then the PowerShell execution policy should be changed

Set-ExecutionPolicy RemoteSigned