VMware Cloud Community
marshallmathers
Enthusiast
Enthusiast
Jump to solution

get vcenter infra quick stats using powercli

im looking to connect to vcenter using powercli and get the following quick stats

eneral Information
General details on the infrastructure
Number of Hosts:#
Number of VMs:#
Number of Templates:#
Number of Clusters:#
Number of Datastores:#
Number of Datastore Clusters:19

can anyone help me with the syntax?

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Like this?

[pscustomobject]@{

   'Number of Hosts' = (Get-VMHost).Count

   'Number of VMs' = (Get-VM).Count

   'Number of Templates' = (Get-Template).Count

   'Number of Clusters' = (Get-Cluster).Count

   'Number of Datastores' = (Get-Datastore).Count

   'Number of Datastore Clusters' = (Get-DatastoreCluster).Count

}

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


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

View solution in original post

3 Replies
LucD
Leadership
Leadership
Jump to solution

Like this?

[pscustomobject]@{

   'Number of Hosts' = (Get-VMHost).Count

   'Number of VMs' = (Get-VM).Count

   'Number of Templates' = (Get-Template).Count

   'Number of Clusters' = (Get-Cluster).Count

   'Number of Datastores' = (Get-Datastore).Count

   'Number of Datastore Clusters' = (Get-DatastoreCluster).Count

}

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


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

marshallmathers
Enthusiast
Enthusiast
Jump to solution

thanks i will try it out

0 Kudos
Surendraa
Contributor
Contributor
Jump to solution

Thank you, it gives a quick over all stats, will be handy at times.

0 Kudos