Install PowerShellGet module


I am working on Windows 2012 R2 and it was running PowerShell version 4.0. I have upgraded to version 5.0.

It seems like that when I do basic commands I get errors, for example,

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 PowerShellGet –Force –Verbose
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

Another example:

Get-Variable : The term ‘Get-Variable’ is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path
is correct and try again. At C:\Program
+ $script:IsWindows = (-not (Get-Variable -Name IsWindows -ErrorAction …
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-Variable:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

I am basically following the installation method for PowerShellGet found here:

I am stuck at the “Install-Module” command in this guide.


Execute the command on your powershell: ‘Set-ExecutionPolicy Unrestricted’ before executing install-module.
(The restricted mode helps you protect from the the unauthorized scripts)


Install PowerShellGet module by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply