Have you been wanting to learn PowerCLI but don’t have a test environment to practice with out the fear of breaking live production? That is where this hands-on-learning (HOL) lab from VMware can come in handy. I personally worked through this HOL and found that the information that was provide to be very thorough to help with beginners wanting to start with PowerCLI. The other best part of this training is that it is free.

HOL-SDC-1607 From Beginner to Advanced Features with PowerCLI

This lab has an interface that provides a windows desktop with PowerShell with PowerCLI module installed. Once you get it going you can either use the lab manual that is integrated into the interface or a provided PDF file so you can review the information at a later time.

Going through the lab manual it starts out slow and provides a lot of useful information, but I did notice that there was an issue when asked to opening the first script, Module7.ps1. It seems as if there was an update to the script that they are asking for, but didn’t update the documentation to reflect the new script name. The script that was needed, Module8.ps1, was located on the desktop of the lab computer. The PowerShell script, Module8.ps1, that is asked to be open has the all of the commands that the lab manual references.

The first part of the course goes over how to get information about the VMs and how to export the data. It has several different ways to format the data; TXT, CSV, XML, and HTML.

Get-VM | Select Name, NumCPU, MemeoryMB, PowerState, VMHost | Out-File C:\MyPowerCLIReport.txt

Get-VM | Select Name, NumCPU, MemeoryMB, PowerState, VMHost | Export-CSV C:\MyPowerCLIReport.CSV -NoTypeInformation

(Get-VM | Select Name, NumCPU, MemeoryMB, PowerState, VMHost | ConvertTo-XML -NoTypeInformation).Save("C:\MyPowerCLIReport.XML")

Get-VM | Select Name, NumCPU, MemeoryMB, PowerState, VMHost | ConvertTo-HTML | Set-Content "C:\MyPowerCLIReport.HTML"

The lab even went into creating a VM cluster and then how to configure DRS and HA. Then once the cluster is setup and configured,

it goes over how to move the hosts into the new cluster using command like the following:

Get-VMHost | Set-VMhost -State Maintenance Get-VMHost | Move-VMHost -Destination $Cluster1 Get-VMHost | Set-VMHost -State Connected

The best part of this training in my mind, is that it goes over how to configure and setup a VDS (Virtual Distributed Switch). In my environment we have been working to re-configure all of our VM clusters to Distributed Switches.

$VDS = New-VDSwitch -Name "Production VDS" - Location "Primary DataCenter"

I thoroughly enjoyed taking this HOL lab and look forward to reviewing the next one:

HOL-SDC-1602 vSphere with Operations Management – Advanced Topics: Module 8 will introduce you to the new PowerCLI cmdlets for managing vRealize Operation Manager.

-Stuart