VMware Cloud Community
mforgetRI
Contributor
Contributor

PowerCLI and Powershell 7 on Windows

Hi all,

First, I apologize if this has been asked and answered.  I don't have much experience with PowerCLI, although I have used Powershell in general for quite some time.  I checked around the forum and the internet and could not find an answer.  I am trying to use PowerCLI with Horizon View 2006 on a Windows 2019 server.  When I first tried to use it, I got a message that I needed a newer version of Powershell.  So I installed Powershell 7 since it is the latest and greatest..

If I try to import the module with "Import-Module VMware.Hv.Helper" I get: "Exception: VMware.VimAutomation.HorizonView module is not currently supported on the Core edition of PowerShell."  So I try " Import-Module VMware.Hv.Helper -UseWindowsPowerShell" and it imports.  Then I try to use the command "Get-HVMachine" and I get "Write-Error: Could not retrieve ViewApi services from connection object".

AFAIK, Powershell 7 is only Core edition, and trying to use the -UseWindowsPowershell to import the module kicks it back to Powershell 5.  So it doesn't work with the older version, and it doesn't work with the newer version.

I contacted VMWare support.  They said I had to contact the SDK team, which apparently is an extra cost, just to find out what I needed to get the commands to execute.  My next step is to try Powershell 6.  I believe it has a core and a non-core edition.  If that works, great, until version 6 gets too old.

If anyone has any thoughts or insight on this, it would be much appreciated.  For all I know, maybe I'm just barking up the wrong tree.  I'm just trying to run a simple script to see if provisioning is enabled.  I just want the tool that VMWare provides to work.

Thanks

0 Kudos
1 Reply
LucD
Leadership
Leadership

I'm afraid you will have to stick with PowerShell 5.1 for that module (for now).
Fyi, on a Windows box PowerShell 5.1 and PowerShell v7 can be installed and used side-by-side


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

0 Kudos