VI Toolkit One Liner: Correct HAL ?

I have just re-worked an old script which I created to check each VM to ensure they are using the correct HAL based on the amount of processors they have installed, as it turns out I managed to get this into a nice one-liner:

Or to break it down so it fits on my blog…



9 thoughts on “VI Toolkit One Liner: Correct HAL ?”

  1. Hi Alan – quick question: I just ran this script for the first time and it is not pulling the HAL info for each guest VM. It pulls the # of vCPUs and the host name, but that is it. I run it with a domain admin acct, so it has local admin rights to every VM so I am not sure what I am missing. Any ideas? BTW – I have just started using PowerCLI and I really enjoy your site/scripts (and others you reference). Thank you so much – many of them have come in very handy. Very nice work.

  2. @nikes
    You should be able to do this by using the following:

    Get-VM | Foreach { Get-WmiObject -ComputerName $_.Name -Class Win32_OperatingSystem | Select CSName, Caption, CSDVersion}

    You will obviously need permission to read the information from each guest system.

  3. @Marc
    You can just pipe this into export-csv Filename, for example:

    | Export-csv c:\temp\HalList.csv

    Add that to the end of the one liner to make it an even longer one-liner and you should have your result 🙂

Leave a Reply