Share via


Cannot install module from PowerShell Gallery

Question

Tuesday, October 18, 2016 11:12 AM | 1 vote

Hi

Got Windows 10 workstation with $PSVersionTable.PSVersion

Major   Minor  Build  Revision
        

5          1        14393   0

I can install on it modules from Chocolatey without problem. So example

PS:\ Choco Install Carbon

install module Carbon without any problems. But when I am trying to make the same from Powershell Gallery, like

PS:\ Install-Module -Name WriteToLogs

Install-Module : The 'Install-Module' command was found in the module 'powerShellget', but the module could not be loaded. For more information, run 'Import-Module PowerShellGet'.
At line:1  char:1

+ Install-Module name WriteToLogs

  • 
    

      + categoryInfo            : ObjectnotFound:  (Install-Module:String) [], CommandnotFoundexception
      + FullyQualifiedErrorId : CouldNotAutoLoadmatchineModule

Ok, so I try, as suggested, Import-Module powerShellGet

PS:\ Import-Module PowerShellGet

but it makes another error

Import-Module : The required module 'Packagemanagement' is not loaded. Load the module or remove the module from 'RquiredModules' in the file 'C:\Program Files\WindowsPowerShell\Modules\PowerSgellGet\1.0.0.1\powershellGet.psd1'.

At line:1 char:1

+ Import-Module PowerShellGet

  • 
    

   + categoryInfo          : ResourceUnavalibly: (C:\Program File ...erShellGet.psd1:String} [import-Module]. Missingmemeberexception
    +  FullyQualifiederrorId: Modules_Invalidmanifest, Microsoft, PowerShell.Commands.ImportModuleComand

Any suggestion? Please advice

Br /Stisse Twardy

All replies (8)

Tuesday, October 18, 2016 11:59 AM ✅Answered

I suspect you have damaged your installation as the PowerShellGet function in installed in PosH 10 by default.

This can happen at times when you upgrade a previous OS and use a pre-release upgrade.

I recommend that you do a full restore of Win 10 and test before adding any other components.

\(ツ)_/


Wednesday, October 19, 2016 3:42 AM

Hi ztwardy,

I have test this issue on my win10,have no issues, below output for your reference.

PS C:\Users\> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
      
5      0      10240  17113


PS C:\Users\> Import-Module PowerShellGet
PS C:\Users\> systeminfo
                                                                              
Host Name:                 WIN10
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.10240 N/A Build 10240
OS Manufacturer:           Microsoft Corporation

Best regards,

Andy

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Monday, October 24, 2016 2:08 AM

 

Hi,

Was your issue resolved?

If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

If no, please reply and tell us the current situation in order to provide further help.

Best Regards,

Andy

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Friday, February 16, 2018 6:17 AM | 3 votes

I recently came across the same problem, I found out that I had few versions of PowerShellGet installed inside:

C:\Program Files\WindowsPowerShell\Modules\PowerShellGet 

If you have more than one, try deleting everything but 1.0.0.1 and update PowerShellGet in a fresh PS console.


Tuesday, March 27, 2018 7:53 AM

Solved my problem!

Kind Regards

Michel


Wednesday, April 18, 2018 9:02 AM

I recently came across the same problem, I found out that I had few versions of PowerShellGet installed inside:

C:\Program Files\WindowsPowerShell\Modules\PowerShellGet 

If you have more than one, try deleting everything but 1.0.0.1 and update PowerShellGet in a fresh PS console.

How do you properly delete everything but 1.0.0.1?

Boudewijn Plomp | Conclusion FIT

Please remember, if you see a post that helped you please click "Vote as Helpful", and if it answered your question, please click "Mark as Answer". This posting is provided "AS IS" with no warranties, and confers no rights.


Thursday, May 17, 2018 12:08 PM

For people reading this and still not able to solve this. Try downloading 5.1 framework https://www.microsoft.com/en-us/download/details.aspx?id=54616 and rebooting. All should work fine after that!


Thursday, May 17, 2018 12:11 PM

For people reading this and still not able to solve this. Try downloading 5.1 framework https://www.microsoft.com/en-us/download/details.aspx?id=54616 and rebooting. All should work fine after that!

Not a solution for this question.  You cannot install WMF 5.1 on Windows 10 or later systems.

\(ツ)_/