Forum Discussion
Cannot install PnP.Powershell
Hi akkers,
The old API v2 URL is deprecated. Microsoft moved to https://www.powershellgallery.com/api/v3.
You could try the following:
Unregister the old PSGallery:
Unregister-PSRepository -Name "PSGallery"
Register the new one (v3):
Register-PSRepository -Name "PSGallery" `
-SourceLocation "https://www.powershellgallery.com/api/v3" `
-InstallationPolicy Trusted
Verify it's updated:
Get-PSRepository
Try installing the module again:
Install-Module -Name PnP.PowerShell
Also check the TLS. (Some systems may not default to TLS 1.2, which is required)
Run below code before installing the module.
This will only affect your current Powershell session, so it wont change it permanently.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12