Pull VM Inventory Specifying The Cluster

This post was originally published on this site

Hello!

 

I noticed this thread about pulling VM inventory from ESXi hosts: VMware PowerCLI Forum – VMware {code}

 

How would I go about modifying this to be a function and specifying the cluster?

 

i.e.

function Get-Inventory ($args1) {

     Get-Cluster “$args1” | Get-VM | etc. etc. …

}

 

My PowerCLI version info below

 

PowerCLI Version

—————-

   VMware PowerCLI 11.2.0 build 12483598

—————

Component Versions

—————

   VMware Cis Core PowerCLI Component PowerCLI Component 11.2 build 12483642

   VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.2 build 12483638

   VMware VimAutomation Srm PowerCLI Component PowerCLI Component 11.2 build 12483605

   VMware VimAutomation License PowerCLI Component PowerCLI Component 10.0 build 7893904

   VMware VimAutomation Vds Commands PowerCLI Component PowerCLI Component 11.2 build 12483615

   VMware Vmc PowerCLI Component PowerCLI Component 11.2 build 12483614

   VMware Nsxt PowerCLI Component PowerCLI Component 11.2 build 12483633

   VMware VimAutomation vROps PowerCLI Component PowerCLI Component 10.0 build 7893921

   VMware HorizonView PowerCLI Component 7.1.0 build 12680098

   VMware VimAutomation Cloud PowerCLI Component PowerCLI Component 11.0 build 10379994

   VMWare ImageBuilder PowerCLI Component 6.7 build 11233116

   VMWare AutoDeploy PowerCLI Component 6.7 build 11233116

   VMware VimAutomation Storage PowerCLI Component PowerCLI Component 11.2 build 12483611

   VMware vSphere Update Manager PowerCLI 6.5 build 7862888

   VMware VimAutomation Security PowerCLI Component PowerCLI Component 11.0 build 10380515

   VMware Hcx PowerCLI Component PowerCLI Component 11.2 build 12483619

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.