2

I was attempting to install the lastest VMWare PowerCLI, and I get an error: Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function...

Some digging shows that I don't have PowershellGet installed, and all of the documentation/downloads either say "Out of the box", or run install-module to install PowershellGet, as there's not a download available for Windows 10.

I don't have a PowershellGet folder in C:\Program Files\WindowsPowerShell\Modules, but I do have PackageManagement.

Where do I find a download for PowershellGet?

Windows 10 version 1709

$PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.16299.248
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.248
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
StormRider01
  • 335
  • 5
  • 19

3 Answers3

1

Install-Module is built in to PowerShell in Windows 10 so it should be present.

This can occur if the Language Mode is not Full Language. I've experienced this with Constrained Language Mode, but haven't tested the others.

Language Mode is controlled by the variable __PSLockdownPolicy. Constrained Language Mode was designed to limit the functionality available to non-administrator users when used with other products like AppLocker or Device Guard User Mode Code Integrity (UMCI).

More information:

https://blogs.msdn.microsoft.com/powershell/2017/11/02/powershell-constrained-language-mode/

https://blogs.technet.microsoft.com/kfalde/2017/01/20/pslockdownpolicy-and-powershell-constrained-language-mode/

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes

Greg Askew
  • 123
  • 2
  • 4
0
Get-Module -ListAvailable Microsoft*| Select name | Out-String | % {$_ -replace "Name"}|% {$_ -replace "-"}|% {$_ -replace " "} |out-file -filepath .\ModulesbyName_Microsoft.txt
Wait-Event -Timeout 5
Get-Content -Path .ModulesbyName_Microsoft.txt | Import-Module -verbose
Patrick Burwell
  • 129
  • 1
  • 12
-1

Check out the PowerShellGallery and you should find everything you need to install PowershellGet. Also its a nice GUI browser for modules.

Sambardo
  • 714
  • 2
  • 9
  • 15
  • 1
    The directions on PowerShellGallery rely on PowershellGet already being installed on Windows 10. – StormRider01 Feb 19 '18 at 16:32
  • The readme linked off the website brings you here: https://learn.microsoft.com/en-us/powershell/gallery/readme The docs page links to an alternate MSI installer – Sambardo Feb 19 '18 at 19:21
  • The MSI won't install on a Windows 10 machine: "Package management requires Microsoft .NET Framework 4.5 or newer, and Windows PowerShell 3.0 or 4.0. Verify that these two prerequisites are met. To install or update Package Management in Windows PowerShell 5.0, install Windows Management Framework 5.0." I ran into similar problems with WMF 5.0/5.1 refusing to install. – StormRider01 Feb 20 '18 at 20:02
  • Oh, bizarre, I can't seem to find anything else about this since its bundled in. If you tried reinstalling WMF and it fails, and its just this one machine, then I'd just manually grab it off another machine to fix it. – Sambardo Feb 20 '18 at 21:25
  • That's what I ended up doing, it's too bad someone took the "But it's in the box!!!" approach. It's a powershell module, not a windows API. – StormRider01 Feb 22 '18 at 13:54
  • I wonder if you can force it via windows features somehow, like disabling and re-enabling power shell through that. – Sambardo Feb 22 '18 at 18:37