Home > Blogs > VMware PowerCLI Blog

Get-View Part 1: Introduction to Get-View

I’ve had several people ask to understand more about Get-View. I will be doing several blog posts on this topic to hopefully help educate on what Get-View is and why it’s useful.

  • Part 1: Introduction
  • Part 2: Extension Data
  • Part 3: Performance Impact

***Note: Get-view is a more advanced feature of PowerCLI. Administrators are able to fully utilize the benefits of PowerCLI without needing to learn Get-View. However, Get-view opens the door for even more flexibility and power in controlling your virtual environment.

Before dealing with Get-View, we need to understand a little bit about how PowerCLI works. The cmdlets like Get-VM will return nicely formatted information about a Virtual Machine, however, when Get-VM is run, there are a number of queries and formatting that takes place in the back-end that result in what is returned.

Screenshot 2014-12-31 11.31.47

What happens when we return this same list using Get-View?


As you can see, a lot more information is returned. If this is the first time you are seeing this output, it can feel a little overwhelming and you will most likely want to just return to using Get-VM. But before you run off, let’s take a deeper look at this and try to understand what we are seeing.

To make this easier to sort through for this first time, let’s run the get-view cmdlet again but this time we’ll filter it for a single VM.

The –Filter parameter requires a hashtable for input, otherwise you’ll receive an error like this:


So we’ll run it the correct way and we’ll search based on the VM’s name.

get-view –viewtype VirtualMachine –filter @{“Name”=”SDDC-VCAC-IAAS”}


Ok, that’s not looking so bad now is it? ok, well you may still be saying “I don’t understand what I’m seeing….” but we have narrowed down the number of lines returned by looking at a single Virtual Machine.

What are we seeing?

What we see when running Get-View is the view object (Do not confuse ‘view object’ with ‘VIobject’ we’ll discuss this later). We can then dig into the different properties for this object and find large sums of information that may be useful for your needs.

We’ll first save our query as a variable:

$VM = get-view –viewtype VirtualMachine –filter @{“Name”=”SDDC-VCAC-IAAS”}

Now by typing the variable name ‘$VM’ we can see and work with the object.


It may take some practice and some time to get to know what all can be found within the view of each object… Don’t despair, it’s well worth it! let’s look in the Config property (VirtualMachineConfigInfo).



Here we can see some interesting information. We can see the VM Name, the Guest full name (Server 2008r2 64-bit), Hardware version, UUID, if it’s a template, and so on. These could be very useful when querying your infrastructure for reporting purposes especially (More to come in another blog post).

If we jump into the Summary section we see a number of other sections we can dive into. We’ll start with Runtime.


Screenshot 2014-12-31 13.12.25

We can see the VM is connected, powered off, VMTools installer is not mounted, etc.

On to Guest:


Screenshot 2014-12-31 13.12.43

We can see here that VMTools is not running, the version is current, hostname, and IP would be here if the VM were powered on. For those of you who may want to write a script that sees if a VM is up and running before continuing, using the ToolsStatus property in a loop is an excellent way to judge if the script should proceed or loop again (*note: just because tools are running doesn’t mean the OS is always ready. sometimes it is good to place a start-sleep in the script once VMTools shows it is running, to ensure that the OS is fully up and running before continuing).

Finally, We’ll look at the Summary Config (do not get confused with the $VM.Config we looked at earlier):


Screenshot 2014-12-31 13.12.49

Here we see the amount of RAM allocated to the VM, the actual path to the VMX (in this case it’s [Datastore] Folder/VMName.vmx), # of CPU, NICs, Disks, and more.

In just a few queries we’ve been able to see a lot of data…

In the next article we will discuss how to use the data we find. and an even easier way of accessing this data for consumption.

Stay Tuned!

This entry was posted in Advanced, Learning, Reporting and tagged , , on by .
Brian Graf

About Brian Graf

Brian Graf is a well-known VMware evangelist in the IT community. Over the past 5 years, Brian has done Technical Marketing for PowerCLI Automation and ESXi Lifecycle, Product Management of vCenter Distributed Resource Management features (DRS & HA), and is currently working as a Technical Marketing Manager for VMware Cloud on AWS. Brian is a co-author of the PowerCLI Deep Dive 2nd edition book. He has helped develop VMware certification courses and exams and presents around the world at VMware User Conferences, AWS Summits, Interop, as well as other industry Conferences. Brian is also a Microsoft MVP.

22 thoughts on “Get-View Part 1: Introduction to Get-View

  1. Pingback: VMware powerCLI | Srinivasu Meesala

  2. Pingback: Newsletter: February 15, 2015 | Notes from MWhite

  3. Pingback: Get-View Part 2: Views and Extension Data | VMware PowerCLI Blog - VMware Blogs

  4. Pingback: vCoffee Links #13 – Lots of good vStuff!!! » vHersey - VCDX Two to the Seventh Power (#128)

  5. Pingback: #PowerCLI: Distributed switch portgroup usage. Good vs. bad vs. Max Power approach | v(e)Xpertise

  6. Greg Sullivan

    Where oh where is the chain length info?

  7. Pingback: Get-View Part 3: Peformance Impact - Is it really THAT much different? | VMware PowerCLI Blog - VMware Blogs

  8. Pingback: Getting VM Information using Get-view | Welcome to deepakkanda's Blog

  9. gajendra d ambi

    this is nice but how do we change certain values here? Let us say i want to change the startorder & startdelay to something else.
    (get-vapp myvapp | get-view).VAppConfig.EntityConfig
    Basically with powercli i want to
    create vapp
    set startorder

    1. CraigR

      To change any of those things, I think you would need to operate on the VM-type object, not the View-of-a-VM-type object.

  10. Pingback: Learn how to generate a vSphere report using PowerShell

  11. Pingback: PowerCLI, VMware Tools update, etc. « rakhesh.com

  12. LUIS

    Good cmdlet but how to query SpaceUsage of a VM with GET-VIEW only and not GET-VM ?

  13. free sound plays

    Terrifiϲ work! Thhis is the type of information that are
    supрosed to be hared across tthe internet. Disgrace on Google ffor no longer positioning thiѕ publish upper!
    Comme on օver and visit my website . Thanks =)

  14. Mike

    NIC/VMTool/Hardware Detail Along With OS Version – Look for Script

  15. Pingback: Oxandrolone USA

  16. Filmstreaming

    Terrifiϲ work! Thhis is the type of information that are
    supрosed to be hared across tthe internet. Disgrace on Google ffor no longer positioning thiѕ publish upper!
    Comme on օver and visit my website . Thanks =)

  17. Pingback: PowerCLI one-liners: Máquinas virtuales sin VMware Tools » Sobrebits

  18. Marcin

    If I use –filter @{“Name”=”NS”} (I have a VM called NS) it returns multiple VMs that contains “NS” in their name.
    How to filter to match exact name?

    1. David McDonough

      Too late to be helpful, but for the next person, the answer is that the filter is regex, so you’d need to specify the beginning and end of the string like this:

      @{ name = ‘^computername$’ }

      ^ means the beginning of the string
      $ means the end of the string

  19. Pinoy Lambingan

    Great web site you have got here.. It’s hard to find quality writing like yours these days. I really appreciate individuals like you! Take care!!

  20. Pinoy Tv Replay Shows

    Hello first time I visit your website. I open some posts and find quality of work, I also like your website layout. I have bookmark your website and again I will visit your website soon.


Leave a Reply

Your email address will not be published. Required fields are marked *