Virtually everything is poshable
PowerCLI: More HAL Information
If you have performed Physical to Virtual (P2V) Migrations before you will know about the significance of having the correct Hardware Abstraction Layer (HAL) installed within the operating system.
Without the correct HAL you may experience a speed decrease or even a hung operating system.
For a single processor VM you will need a Uniprocessor Hal and for a multi (2-8) processor VM you will need a Multiprocessor Hal.
The following one-liner expands on my previous one-liner to include the following information:
- Name
- Number of CPUs
- HAL installed in the OS
- OS Version
- OS Service Pack Version
Note: You will need access to read WMI information from the guest operating system with the account which runs this script.
- Get-VM |Where {$_.PowerState -eq “PoweredOn“} |Sort Name |Select Name, NumCPU, @{N=“OSHAL“;E={(Get-WmiObject -ComputerName $_.Name-Query “SELECT * FROM Win32_PnPEntity where ClassGuid = ‘{4D36E966-E325-11CE-BFC1-08002BE10318}’“ |Select Name).Name}}, @{N=“OperatingSystem“;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select Caption).Caption}}, @{N=“ServicePack“;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select CSDVersion).CSDVersion}}
An example output from this script with using Export-CSV on the end shows us the information we need to rectify any potential VM mis-configurations:
For advice on how to convert the HAL you are using follow these steps over on vmetc.com
| Print article | This entry was posted by Virtu-Al on October 12, 2009 at 13:57, and is filed under PowerCLI, vmware. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |







(3)
(13)
(0)
about 10 months ago
Are you talking about me?
about 10 months ago
@Hal Rottenberg
Yes I finally worked out the code that converts you into a virtual Hal so we can all have our own little PowerCLI Guru.
about 10 months ago
Thank you! You often write very interesting articles. You improved my mood.
about 8 months ago
I didn’t get the OSHAL with your script. The Get-WmiObject -ComputerName $_.Name-Query “SELECT * FROM Win32_PnPEntity where ClassGuid = ‘{4D36E966-E325-11CE-BFC1-08002BE10318}’“ gave an Invalid Query error on the where clause. So I changed the script to:
Get-VM |Where {$_.PowerState -eq “PoweredOn”} |Sort Name |Select Name, NumCPU, @{N=”OSHAL”;E={(Get-WmiObject -ComputerName $_.Name-Query “SELECT * FROM Win32_PnPEntity” |Where { $_.ClassGuid -eq ‘{4D36E966-E325-11CE-BFC1-08002BE10318}’ } |Select Name).Name}}, @{N=”OperatingSystem”;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select Caption).Caption}}, @{N=”ServicePack”;E={(Get-WmiObject -ComputerName $_ -Class Win32_OperatingSystem |Select CSDVersion).CSDVersion}}
This version works for me.
about 4 months ago
Would it be possible to include this script in your vCheck script?