Install PnP.PowerShell modules fails with not a properly-formed module warning

%3CLINGO-SUB%20id%3D%22lingo-sub-3074054%22%20slang%3D%22en-US%22%3EInstall%20PnP.PowerShell%20modules%20fails%20with%20not%20a%20properly-formed%20module%20warning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3074054%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20install%20PnP.PowerShell%20on%20a%20Windows%202012%20R2%20server%20and%20it's%20not%20installing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20I%20get%20is%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EVERBOSE%3A%20Hash%20for%20package%20'PnP.PowerShell'%20does%20not%20match%20hash%20provided%20from%20the%20server.%0AVERBOSE%3A%20InstallPackageLocal'%20-%20name%3D'PnP.PowerShell'%2C%20version%3D'1.9.0'%2Cdestination%3D'C%3A%5CUsers%5C...%5CAppData%5CLocal%5CTemp%5C2%5C462159576'%0AWARNING%3A%20The%20module%20'PnP.PowerShell'%20cannot%20be%20installed%20or%20updated%20because%20it%20is%20not%20a%20properly-formed%20module.%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20the%20Windows%20Server%20this%20is%20the%20PowerShell%20version%3A%3CBR%20%2F%3EMajor%20Minor%20Build%20Revision%3CBR%20%2F%3E-----%26nbsp%3B%26nbsp%3B-----%26nbsp%3B%26nbsp%3B-----%20--------%3CBR%20%2F%3E5%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B0%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B10586%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20117%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-Module%20PnP.PowerShell%20-ListAvailable%20returns%20nothing%2C%20so%20no%20module%20is%20installed%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20another%20discussion%20on%20github%20without%20any%20results%2C%20either%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2Fpowershell%2Fdiscussions%2F453%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fpnp%2Fpowershell%2Fdiscussions%2F453%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20give%20me%20a%20hint%20how%20get%20PnP.PowerShell%20installed%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3074054%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3074103%22%20slang%3D%22en-US%22%3ERe%3A%20Install%20PnP.PowerShell%20modules%20fails%20with%20not%20a%20properly-formed%20module%20warning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3074103%22%20slang%3D%22en-US%22%3Einstall-module%20pnp.powershell%20should%20work%20(Just%20tried%20it%20on%20a%20Windows%20server)%2C%20perhaps%20the%20TLS%20settings%3F%20First%20run%20%5BSystem.Net.ServicePointManager%5D%3A%3ASecurityProtocol%20%3D%20%5BSystem.Net.ServicePointManager%5D%3A%3ASecurityProtocol%20-bor%20%5BSystem.Net.SecurityProtocolType%5D%3A%3ATls12%20and%20then%20try%20the%20install-module%20pnp.powershell%20again.%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

 

I'm trying to install PnP.PowerShell on a Windows 2012 R2 server and it's not installing.

 

All I get is:

VERBOSE: Hash for package 'PnP.PowerShell' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='PnP.PowerShell', version='1.9.0',destination='C:\Users\...\AppData\Local\Temp\2\462159576'
WARNING: The module 'PnP.PowerShell' cannot be installed or updated because it is not a properly-formed module.

 

On the Windows Server this is the PowerShell version:
Major Minor Build Revision
-----  -----  ----- --------
5       0       10586     117

 

 

Get-Module PnP.PowerShell -ListAvailable returns nothing, so no module is installed

 

There is another discussion on github without any results, either

https://github.com/pnp/powershell/discussions/453

 

Can you give me a hint how get PnP.PowerShell installed?

 

Thanks!

3 Replies
install-module pnp.powershell should work (Just tried it on a Windows server), perhaps the TLS settings? First run [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 and then try the install-module pnp.powershell again.
Thanks for that input, unfortunately it didn't help. Get the same warning and the module is not installed
- Did you specify a specific version? Default what is tried to install is 1.9.0
- is it required to update somehow the link to the powershellgallery?
Didn't install a specific version, just the install-module pnp.powershell. Perhaps uninstalling the old module SharePointPnPPowerShellOnline is you used that before?
https://pnp.github.io/powershell/articles/upgrading.html