Posts under ‘PowerShell’

PowerCLI 4.1 namespace changes

Output type changes in PowerCLI 4.1In PowerCLI 4.1 VMware changed the namespaces of the output types. According to VMware, this was done to improve the internal structure and enable other VMware teams to write cmdlets for the products they develop. You can read all about it in the vSphere PowerCLI blog article Output type changes [...]

Collect VMware ESX Host PCI Device Information

Whenever you need to install a new box with ESX, there’s the struggle with matching physical ports to VMware devices. Which network adapter becomes vmnic0?, Which hostbus adapter becomes vmhba1?, etc. Especially when you have a lot of network adapters this can be confusing and you can’t connect to the device over the network unless you [...]

PowerCLI: Reset CPU and Memory Limits

Today I noticed a memory limit on a vm. After investigating my environment using the vEcoShell and the Community PowerPack, I found more vms with memory limits set. It turned out that there was a template which had the limit set. I could easily reset all limits using the GUI, but I thought I rather do it [...]

PowerCLI: Disable/Enable HA and DRS

Before upgrading my Virtual Center 2.5 server to vCenter Server 4.0, I decided to temporarily disable HA and DRS. This is just a precaution taken to avoid waiting for cluster reconfigurations right after the upgrade. Because I hate doing things more than once by hand, I used PowerCLI for this.
Although no rocket science you can use the [...]

PowerCLI: Match VM and Windows harddisks – Part 2

This is a follow up on a post I did a couple of weeks ago to create a mapping table between Windows- and VMware hard disks. In another previous post PowerCLI: Get WMI info from isolated guests, I showed you how to get WMI info from a guest without using the guest’s network. I used this [...]

PowerShell / PowerCLI linkage

Since I started looking into PowerShell and PowerCLI, I gathered a couple of links which I found interesting and useful. I needed a way for them to be accessible anytime anywhere. Obviously the first thing that came across my mind was putting them on my blog somewhere.
I decided to dedicate a page on my blog [...]

PowerCLI: Get WMI info from isolated guests

A few weeks back I posted an article on matching Windows and VMware disks. Unfortunately this would work only if you could remotely query WMI information from that VM. If you have any VM that’s isolated or behind a firewall, you are out of luck. This bothered me, so I started looking for a uniform [...]

Match VM and Windows harddisks using PowerCLI

Today I was asked to extend a disk of a Windows virtual machine. Normally this is a standard procedure and finished within minutes. The hardest part of the procedure is to check the scsi id from within Windows and match the Windows disk to the corresponding virtual disk in the virtual machine’s hardware settings. Unfortunately [...]

$Null or Nothing?

When looking at a lot of PowerCLI scripts available I noticed that people tend to forget to validate their output. For example let’s look at the following piece of code:
$Vms = Get-VM
Although this command will return a collection in almost all cases, it can however return 3 different output types. It can return a collection, [...]

PowerCLI 4.0 Update 1- Another leap forward

Last week VMware released PowerCLI 4.0 Update1. According to the PowerCLI blog this new version contains over 60 new cmdlets as well as greatly improved performance.
One great thing is that they put the cmdlet reference online. I always like references online, because they are always at your disposal. When I ‘m working on my scripts, [...]