Book “Learning PowerCLI” is now available for pre-order

0167EN_mockupcover_normalSome of you may have noticed that I have not been blogging very much lately. This is because I am now writing my first book “Learning PowerCLI”.

This book is aimed at beginning and advanced PowerCLI users and will help you to automate your VMware vSphere environment including hosts, clusters, storage, virtual machines, networks and vCenter Server. The book teaches you how to use old and new VMware vSphere features like Datastore Clusters, the vSphere Distributed Switch, Host Profiles, Image Builder and Autodeploy, Storage I/O Control and much more using PowerCLI.

The expected release date of the “Learning PowerCLI” book is November 2013.

The “Learning PowerCLI” book is available for pre-order at

Upgrading your VMFS datastores with PowerCLI

PowerCLI logoWith the release of VMware vSphere 5.0 a new version of the VMFS datastores was released also: VMFS-5. This new VMFS-5 version has a lot of advantages over the old VMFS-3 version (see for information about the new features Cormac Hogan’s post vSphere 5.0 Storage Features Part 1 – VMFS-5). You can upgrade your VMFS-3 datastores to VMFS-5 while VM’s on the datastores keep running. In this post I will show you the vSphere PowerCLI Upgrade-VmfsDatastore function that will do the upgrade for you. Read more of this post

PowerCLI Get-VICommand function error repaired

PowerCLI logoOn my PC (Windows 8 Pro, Windows PowerShell 3 and VMware vSphere PowerCLI 5.1 Release 2) there is a very annoying problem with the Get-VICommand function. If I use this function without specifying the name of a cmdlet to search for, then I get an “Object reference not set to an instance of an object” error message:

PowerCLI C:\users\robert> Get-VICommand
get-command : Object reference not set to an instance of an object.
At C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1:68 char:3
+   get-command -pssnapin VMware.* -Name $Name
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Command], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetCommandCommand

Listing 1. Get-VICommand error message with PowerShell 3.
Read more of this post

Get VMware vCenter Scheduled Tasks with PowerCLI

PowerCLI logoVMware vSphere PowerCLI is missing cmdlets to work with VMware vCenter Scheduled Tasks. In a series of blog posts I will show you some PowerShell advanced functions that you can use to work with vCenter Scheduled Tasks. The first function is Get-VCScheduledTask. You can use this function to retrieve one or more scheduled tasks from your vCenter Server. Read more of this post

Use PowerCLI to consolidate snapshots in vSphere 5

PowerCLI logoIn vSphere 5 a virtual machine can have a “Virtual machine disks consolidation is needed” Configuration Issue warning in the Summary tab. How can you use PowerCLI to see which virtual machines have this warning? And how can you automate the consolidation of the virtual machine’s disks? Read more of this post

1st Dutch PowerShell User Group (DuPSUG) meeting

  • PowerShell logoFriday, November 23, 2012 the first Dutch PowerShell User group (DuPSUG) meeting will be held in Eindhoven, The Netherlands. Speakers are:
    Microsoft Scripting Guy Ed Wilson, PowerShell MVP Richard Siddaway, Bert Wolters, Stefan Stranger and Jeff Wouters.

    Session topics are:

    • Using Windows PowerShell 3.0 to manage the remote Windows 8 workstation
    • PowerShell and WMI
    • What’s new in PowerShell 3.0
    • Protect your PowerShell scripts with version control
    • From command, to script, to function, to advanced function, to tool

    More information can be found at: 1st DuPSUG meeting.

  • PowerShell 3.0 is available for download

    PowerShell logoSince September 4th 2012 is PowerShell 3.0 available for download. PowerShell 3.0 is included in the Windows Management Framework 3.0 that contains also WMI and WinRM. It can be installed on Windows 7 SP1, Windows Server 2008 R2 SP1 and Windows Server 2008 SP2. Windows Management Framework 3.0 requires Microsoft .NET Framework 4.0. PowerShell 3.0 is a standard component of Windows 8 and Windows Server 2012. Read more of this post