-
Notifications
You must be signed in to change notification settings - Fork 662
Install SharePointPnPPowerShellOnline, PowerShell 5.0 and Nuget behind proxy
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
$wc = New-Object System.Net.WebClient
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
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 default repository if none available:
Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted
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