VMware Cloud Community
GarTomlon
Enthusiast
Enthusiast

Powershell Horizon View Powercli

Been using Powershell for a little bit.  Very new to PowerCli.  Even newer to the HZVHelper (is that correct?).  Right now learnign the nuances.   For instance, I have a script that simply Get-HVPoolSummary -UserAssignment Dedicated (obviously after connecting to the connection server).  Running the script as a whole, I get this output, where I would expect tabular format with real data.  What am I missing?

Id : VMware.Hv.DesktopId
DesktopSummaryData : VMware.Hv.DesktopSummaryData
RefId :

Id : VMware.Hv.DesktopId
DesktopSummaryData : VMware.Hv.DesktopSummaryData
RefId :

Id : VMware.Hv.DesktopId
DesktopSummaryData : VMware.Hv.DesktopSummaryData
RefId :

 

 

Reply
0 Kudos
5 Replies
fabio1975
Commander
Commander

Ciao 

Do you have to install and import the  VMware.HV.Helper Module? 

 

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

Reply
0 Kudos
LucD
Leadership
Leadership

Since you can call Get-HVPoolSummary, I suspect it is safe to assume that you installed the VMware.Hv.Helper module

Unfortunately, the Get-HVPoolSummary cmdlet returns raw data.
And you probably only want to see what is under DesktopSummaryData

Get-HVPoolSummary -UserAssignment Dedicated |
Select -ExpandProperty DesktopSummaryData

To have the result in tabular format, you might try piping the result to Format-Table

Get-HVPoolSummary -UserAssignment Dedicated |
Select -ExpandProperty DesktopSummaryData |
Format-Table


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

Tags (1)
Reply
0 Kudos
fabio1975
Commander
Commander

Hi @LucD

Ok I remembered a similar problem, the strange thing that on Windows 10 I installed the VMware.Hv.Helper module and it doesn't ask me for additional parameters and I don't understand why:

fabio1975_0-1651764874547.png

 

 

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

Reply
0 Kudos
GarTomlon
Enthusiast
Enthusiast

I guess ultimately, what I am having issue with is dont know if it is the hierarchy of the hzvhelper , API or what not.  Not even sure where to look to learn about.  

 

For instance, what I am looking to do specifically is I would like a report or output that shows the dedicated pools name, number of VMs, and how many Vms in that pool has an assigned user.  I am comfortable learning Powershell, however, with the Powercli HZVhelper/api layout , just not sure where to look.

 

Any pointers would be great.

Reply
0 Kudos
LucD
Leadership
Leadership

Unfortunately the HV.Helper module is not really what one would expect from a PowerShell module.
The basic information on what is there and how to get it is available in the Horizon API Reference.

The HV.Helper module is nothing more than a wrapper around the API, and not a good one at that.

It might help to check how some others have implemented using the API from PowerShell.
See for example VMware Horizon – Powershell scripting (Desktop Pools)


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

Reply
0 Kudos