VMware Cloud Community
Taher101
Contributor
Contributor

PowerCLI Version

Hi all,
 

I've installed PowerCLI 6.5 on my Computer. When I type " Get-Module -ListAvailable VMware.PowerCLI " or " Get-PowerCLIVersion ", I get that I've probably vesion 10.0 installed, like the image below.  What me surprised is that, when I run these scripts on Commandline  using "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Get-Module -ListAvailable VMware.PoweCLI" " I get nothing!!

When I go to programms installs/uninstall I see PowerCLI version 6.5 !!


Could someone help me 🙂

Thanks

0 Kudos
16 Replies
LucD
Leadership
Leadership

Oops, looks like you multiple versions installed.

What I would suggest:

  • Uninstall the MSI installation via Programs and Features
  • Remove all the PowerCLI modules. Check the folders where they can be via $env:PSModulePath
    • Make sure to check for 32- and 64-bit folders (if you have both PowerShell versions on the station). You can start both versions from the following folders
      • C:\Windows\System32\WindowsPowerShell\v1.0
      • C:\Windows\SysWOW64\WindowsPowerShell\v1.0
  • Eventually, reboot the station
  • Install the latest version with Install-Module


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

Hi,

thanks for your Aswer Smiley Happy
I did that but still get " VMware PowerCLI 10.0.0 build 7895300 " when I type " Get-PowerCLIVersion ".
But when I type "  Get-Module -ListAvailable VMware.* " or " Get-Module -ListAvailable VMware.PowerCLI "

I get nothing, since I did get the Version 10 bevor I uninstalled PowerCLI and its Modules.
I dont understand it, in the Dokumentation " Get-PowerCLIVersion " gets the version of the installed PowerCLI.

How could this happen?

Best regards

0 Kudos
LucD
Leadership
Leadership

What do you have in the variable $env:PSModulePath?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

I've got 4 pathes, I have deleted all PowerClI modules from these pathes!
furthermore when I type " Uninstall-Module -Name VMware.PowerCLI " I get this error message (the same error by update, install too!!)

(

Uninstall Modules: The naming "Uninstall Module" was not named as a cmdlet, a function, a Script file or an executable program detected. Check the spelling of the name, or whether the path is correct (if included), and try again.

In Zeile:1 Zeichen:1

+ Uninstall-Module -Name VMware.PowerCLI

+ ~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Uninstall-Module:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

)

0 Kudos
LucD
Leadership
Leadership

Ok, and which PowerShell version are you running?

What is in $PSVersionTable


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

Name                           Value

----                           -----

PSVersion                      5.1.16299.251

PSEdition                      Desktop

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}

BuildVersion                   10.0.16299.251

CLRVersion                     4.0.30319.42000

WSManStackVersion              3.0

PSRemotingProtocolVersion      2.3

SerializationVersion           1.1.0.1

0 Kudos
LucD
Leadership
Leadership

Ok, then you should be set.

Can you run, from a promt with elevated permissions, the following

Install-Module -Name VMware.PowerCLI

and what you get on screen?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

"The command "Install-Module" is either misspelled or could not be found " Command Prompt started as Administrator. Smiley Sad

I've realized another thing, when I type " Get-PowerCLIVersion " as Administrator I get the same Error which I got by install,update and delete. May that mean anything?

0 Kudos
LucD
Leadership
Leadership

That means you are missing the PackageManagement module.

Do a

Install-Module -Name PackageManagement


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

unfortunately same error neither when I run Powershell as admin or not!
"install-Module" is not found.

0 Kudos
LucD
Leadership
Leadership

Does this install Packagemanagement?

Install-Package -Name Packagemanagement -Verbose


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

same error too.
it does not install anything since it does not recognize what install-Module/Package is.

ERROR:

Uninstall Modules: The naming "Uninstall Module" was not named as a cmdlet, a function, a Script file or an executable program detected. Check the spelling of the name, or whether the path is correct (if included), and try again.

0 Kudos
LucD
Leadership
Leadership

Your system really seems to be messed up.

Can you uninstall/install WMF 5.1?

And make sure you install the correct WMF 5.1 file for your platform.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

I have Windows 10 ? It is not supported

0 Kudos
LucD
Leadership
Leadership

Normally Windows 10 comes with PowerShell 5.0.

If you applied all the Windows 10 patches and updates, then you should be having PowerShell 5.1.

Is that the case, did you apply all Windows 10 patches and updates.

One more thing you could try, does this work?

Install-PackageProvider Nuget –force –verbose


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Taher101
Contributor
Contributor

Hi,
I have solved the problem as follows:
I've deleted all PowerCLi modules then I've copied the Packagemanagement  module from other computer with USB-Stick to mine. The script :

install_Module -Name VMware.PowerCLI did reaally work Smiley Happy
Thanks for your help
RegardsTaher

0 Kudos