VMware Cloud Community
JMichel974
Enthusiast
Enthusiast
Jump to solution

get-pool not recognized as a name of a cmdlet

Hi Team,

Here my conf :

- VMware PowerCLI 6.5 Release 1 build 4624819

- VMware vCenter Server Version 5.5.0

- ESX Version 5.5U3 (3029944)

I want to make a script with PowerCLI modifying the power policy for desktop pools into "Power Off" for all my pools.

But the command 'Get-Pool' doesn't work.

I did this so far :

Install Advanced Functions

- Go to the GitHub repository page at  https://github.com/vmware/PowerCLI-Example-Scripts.

- Click the green Clone or download button and then click Download ZIP.Advanced Functions Download

- Extract the zip file and copy the advanced functions Hv.Helper folder to a modules directory.

- Check your PowerShell $env:PSModulePath variable to see which directories are in use:

- Unblock the advanced functions to allow them to be executed.

dir ‘C:\Program Files\WindowsPowerShell\Modules\VMware.HvHelper\’ | Unblock-File

I heard in the new versions of PowerCLI the command 'Get-Pool' doesn't exist anymore, is that true ?

Thanks in advance for your help.

Best regards,

M. JOSEPH

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

It's Get-HVPool


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

View solution in original post

Reply
0 Kudos
27 Replies
LucD
Leadership
Leadership
Jump to solution

The VMware.VimAutomation.HorizonView module does indeed not contain a Get-Pool cmdlet.

But the VMware.HV.Helper module does have the Get-HVPool cmdlet.


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

Thank you for your answer,

I did 'Import-Module VMware.HV.Helper' but I still have 'get-pool' not recognize :/.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

It's Get-HVPool


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

Indeed, it works better.

I have another issue but I'll seek on the web for it :

Get-HVPool : Could not retrieve ViewApi services from connection object

Anyway, Thank you LucD.

Best regards

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you do a Connect-HVServer?


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

I did 'Connect-ViServer' instead of 'HVServer'.

I just try 'Connect-HVServer' :

Connect-HVServer -Server X.X.X.X -User mylogin -Password mypass -Domain mydomain

And I get this :

Connect-HVServer : Remote server returned an unexpected response : (400) Bad Request.

Line character:1 : 1

+ Connect-HVServer -Server ....

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

    + CategoryInfo          : NotSpecified: (:) [Connect-HVServer], Exception

    + FullyQualifiedErrorId : System.Exception,VMware.VimAutomation.HorizonView.Commands.Cmdlets.ConnectHVServer

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

I'm reading these posts where you answered good stuff that is helping me :smileysilly: :

PowerCLI - List All View Connected Users and VM HostNames

How to get Horizon pool details from PowerCLI

Seems I'm not the only one to not be aware about the new features PowerCLI's versions Smiley Happy.

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

Well, I tried some tips you gave on older threads but it didn't solve my issue unfortunately Smiley Sad.

I'm still looking why I can't connect to my server.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Just to make sure, you are doing the Connect-HVServer to a Connection Server?


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

Well, I tried with my VCenter server first and I got the error bad request.

Then I tried with my CS and I got this :

Connect-HVServer: There was no endpoint listening on https: // ConnectionServer / view-vlsi / sdk that can accept the message. This is often due to an incorrect action or SOAP action.

If present, see the InnerException element for more information.

To the character Line: 1: 1

+ Connect-HVServer -Server XXX -User Login-Password XXX...

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

+ CategoryInfo: NotSpecified: (:) [Connect-HVServer], Exception

+ FullyQualifiedErrorId: System.Exception, VMware.VimAutomation.HorizonView.Commands.Cmdlets.ConnectHVServer

To modify a pool setting to all my pools, do I have to connect to my vCenter Server or my ConnectionServer ?

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

I also tried one of your tips from another thread :

"I suspect a certificate issue.

Can you try and set the following

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

and then try the Connect-VIServer again?"

There is no message about certificate but when I do : Get-HVPool =>

Get-HVPool : Could not retrieve ViewApi services from connection object

Au caractère Ligne:1 : 1

+ Get-HVPool

+ ~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-HVPool

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Could it be that you have a Firewall active on your Connection Server?

Can you connect with the web interface to the Connection Server (from another station)?


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

I don't know if I have a Firewall active on my CS, but certainly the windows firewall is activated.

I'm working in a big company and I'm really restricted with my rights.

I have rights on vCenter and View Admin > And I have acces to them with the webUI.

Maybe my PowerCLI's version is too recent for my infra. Are all the new features compatible with all ESX's versions ?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Your PowerCLI version is not the most recent (PowerCLI is currently at 10.1.0), and perhaps you should consider upgrading.

You didn't specify which View version you are using, but in the compatibility matrix you can find which PowerCLI versions are supported with which Horizon View version.


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

I have Horizon View 5.3.4 build-2581701

In your link, there is no results for my PowerCLI's version and Horizon View 5.3.4.

Maybe instead of upgrading, I need to downgrade my PowerCLI. What do you suggest ?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Oh my, that View version requires the PSSnapin that can be installed on the Connection Server(s).

These PSSnapin are installed with the Connection Server SW, and need to be run on the Connection Server(s).

See VMware View 5.2 Documentation Library

And in that version you have the Get-Pool cmdlet.


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

Sorry, but I don't get it Smiley Sad.

It says : On the remote system, open the following file: C:\Windows\System32\WindowsPowerShell\v1.0\Profile.ps1

Which remote system ? I'm using PowerCLI from my laptop, there is no such file in my folder.

This command : Get-Command -PSSnapin VMware.View.Broker | more, returns nothing.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That was the limitation with the old View, the PowerCLI PSSnapin are installed on the Connection Servers, and the scripts that use these PowerCLI cmdlets need to run on the Connection Server.

That can be with a PS session on the Connection Server or via a PSRemote session from your workstation to the Connection Server.

See my How To Run View PowerCLI


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

Reply
0 Kudos
JMichel974
Enthusiast
Enthusiast
Jump to solution

Thank you very much,

I don't have access to the videos on your link, so I asked to have the rights to see them.

Then I'll try your solution.

Is there no other solutions for me to connect my vCenter or CS with my PowerCLI 6.5 ?

If I find a old version of PowerCLI, it would be easier no ?

Anyway, I'll be back when I try your solution.

Reply
0 Kudos