Home > Blogs > VMware PowerCLI Blog > Monthly Archives: March 2016

Monthly Archives: March 2016

Free PowerCLI Training (or a test lab) now available

You still haven’t learned PowerCLI?  What are you waiting for?

Now, you have no excuse, recently we split out the PowerCLI content into its own lab to allow you to get started with PowerCLI for FREE!

The PowerCLI lab contains a step by step course on PowerCLI enabling you to go from a beginner all the way to an expert, its a handy way to learn in the safe knowledge that you will not harm anything in your environment.

It also makes for a great test lab for testing your scripts, did you know you can paste your code into the environment, here is how:

SendScripts

Learn more from the PM in this quick video

Where do I go to get started?

You can take the lab by visiting http://vmware.com/go/PowerCLILab

New release: PowerCLI 6.3 R1–Download it today!

It is my pleasure to inform you that vSphere PowerCLI 6.3 Release 1 has now been released and as usual we have some great features to ensure you are able to automate even more features and in this release, faster than ever!  As always we take feature requests directly from customers, through feedback at conferences, by looking at the communities and multiple other ways. please do keep giving us your feedback to enable us to keep making the product easier and making automation tasks less painful.

PowerCLI 6.3 R1 introduces the following new features and improvements:

 

Get-VM is now faster than ever!

imageThe Get-VM Cmdlet has been optimized and refactored to ensure maximum speed when returning larger numbers of virtual machine information. This was a request which we heard time and time again, when you start working in larger environments with thousands of VMs the most used cmdlet is Get-VM so making this faster means this will increase the speed of reporting and automation for all scripts using Get-VM. Stay tuned for a future post where we will be showing some figures from our test environment but believe me, its fast!

 

New-ContentLibrary access

imageNew in this release we have introduced a new cmdlet for working with Content Library items, the Get-ContentLibraryItem cmdlet will list all content library items from all content libraries available to the connection. This will give you details and set you up for deploying in our next new feature….

The New-VM Cmdlet has been updated to allow for the deployment of items located in a Content Library. Use the new –ContentLibrary parameter with a content library item to deploy these from local and subscribed library items, a quick sample of this can be seen below:

$CLItem = Get-ContentLibraryItem TTYLinux
New-VM -Name “NewCLItem” -ContentLibraryItem $CLItem -Datastore datastore1 -VMHost 10.160.74.38

Or even simpler….

Get-ContentLibraryItem -Name TTYLinux | New-VM -Datastore datastore1 -VMHost 10.160.74.38

 

ESXCLI is now easier to use

Another great feature which has been added has again come from our community and users who have told us what is hard about our current version, the Get-Esxcli cmdlet has now been updated with a –V2 parameter which supports specifying method arguments by name.

The original Get-ESXCLI cmdlet (without -v2) passes arguments by position and can cause scripts to not work when working with multiple ESXi versions or using scripts written against specific ESXi versions.

A simple example of using the previous version is as follows:

$esxcli = Get-ESXCLI -VMHost (Get-VMhost | Select -first 1)

$esxcli.network.diag.ping(2,$null,$null,“10.0.0.8”,$null,$null,$null,$null,$null,$null,$null,$null,$null)

Notice all the $nulls ?  Now check out the V2 version:

$esxcli2 = Get-ESXCLI -VMHost (Get-VMhost | Select -first 1) -V2

$arguments = $esxcli2.network.diag.ping.CreateArgs()

$arguments.count = 2

$arguments.host = “10.0.0.8”

$esxcli2.network.diag.ping.Invoke($arguments)

 

Get-View, better than ever

imageFor the more advanced users out there, those who constantly use the Get-View Cmdlet you will be pleased to know that a small but handy change has been made to the cmldet to enable it to auto-complete all available view objects in the Get-View –ViewType parameter, this will ease in the use of this cmdlet and enable even faster creation of scripts using this cmdlet.

 

Updated Support

As well as the great enhancements to the product listed above we have also updated the product to make sure it has now been fully tested and works with  Windows 10 and PowerShell v5, this enables the latest versions and features of PowerShell to be used with PowerCLI.

PowerCLI has also been updated to now support vCloud Director 8.0 and vRealize Operations Manager 6.2 ensuring you can also work with the latest VMware products.

 

More Information and Download

For more information on changes made in vSphere PowerCLI 6.3 Release 1, including improvements, security enhancements, and deprecated features, see the vSphere PowerCLI Change Log. For more information on specific product features, see the VMware vSphere PowerCLI 6.3 Release 1 User’s Guide. For more information on specific cmdlets, see the VMware vSphere PowerCLI 6.3 Release 1 Cmdlet Reference.

You can find the PowerCLI 6.3 Release 1 download HERE. Get it today!

Managing the Virtual Machine Lifecycle with PowerCLI

 

Following the last videos showing an introduction to PowerCLI and Reporting in PowerCLI there is now a new video that takes you through managing the virtual machine lifecycle with PowerCLI, these videos are a fantastic, quick way to learn PowerCLI tips and tricks.

Administrators are no longer responsible for managing single digit servers, they now have hundreds or even thousands to maintain. The automation capabilities of PowerCLI allow you to manage the lifecycle of a single virtual machine, or a large number of virtual machines, by using custom scripts.

Every stage of the virtual machine lifecycle, from creation and modification to migration and deletion, can be automated with just a few lines of PowerCLI code. What’s more, the number of virtual machines that you are managing, has no significant impact on the complexity of the PowerCLI scripts that you need to use.

This latest video shows how to perform the following tasks easily:

  • Create a single VM
  • Deploy a VM from a Template
  • Deploy a VM using a customization specification
  • Deploying VMs from a CSV file into multiple folders
  • Change resources assigned to a VM (CPU/Mem)
  • Move a large number of VMs from one network to another
  • Move VMs to a new folder
  • vMotion VMs between hosts
  • Storage vMotion VMs to a new datastore
  • Remove Virtual Machines

All this in under 5 minutes!

Watch the video