PowerCLI GitHub Repo – March 2014 Updates

In March, I created my PowerCLI GitHub Repo with just two cmdlets. By the end of March, I had many more cmdlets in the repo. Here are the updates:

PowerCLI-Administrator-Cmdlets

Via http://tenthirtyam.org/per-cluster-cpu-and-memory-utilization-and-capacity-metrics-with-powercli/ (@medavamshi):

  • Get-ClusterStats – A very detailed report on current Cluster resources and rough estimates of resources available after 1 or 2 cluster member failures. Useful in predicting failure scenarios as well as an eyeball view of capacity management.

Via http://hostilecoding.blogspot.com/ (@hostilecoding):

  • Edit-v10VMs – An alternative GUI to vCenter that can edit VMs with vHW 10. Useful for those without vCenter or who do not like the vSphere Web Client.

Via http://myvirtualcloud.net/?p=5924 (@StevenPoitras and @andreleibovici) are a pair of cmdlets useful for stress-testing your storage (and vCenter, if you’re not careful):

  • Clone-VM – Spin up a specified number of clones of the named VM, using VAAI by default.
  • Unclone-VM – Provide the name of the cloned VM and stop/delete all the clones.

Via http://pelicanohintsandtips.wordpress.com/2014/03/13/creating-multiple-virtual-machines-with-powercli/ is a single cmdlet for Template deployments

  • Deploy-Template – Use an existing Template and OSCustomizationSpec to deploy multiple instances of a Template into a specified Datacenter/Folder with sequential IPs.

PowerCLI-User-Cmdlets

Via http://www.shogan.co.uk/vmware/three-powercli-scripts-for-information-gathering-vms-hosts-etc/ (@shogan85) come three cmdlets that all have the option to output to CSV as well:

  • Get-VMHostBIOSInfo – Report on the Model and BIOS of all VMHosts attached to your connected vCenter.
  • Get-VMHostESXInfo – Report on the ESX(i) version and build of all VMHosts attached to your connected vCenter.
  • Get-VMHardwareInfo – Report on the vHW version of all VMs in a specified datacenter.

Via http://hostilecoding.blogspot.com/ (@hostilecoding):

PowerCLI GitHub Repo

Over the past couple of weeks, I’ve done a few PowerCLI posts, including creating some modules. To reduce the change of typos or older versions of files making it into my posts, I created a GitHub repo, https://github.com/rnelson0/powercli-modules/, that you can feel free to use. There are three modules:

  • Copy-Module – Based off the Hey Scripting Guy! module, this enhanced module allows us to load modules in the Global Modulepath (when run with admin privs) and overwrite existing modules.
  • PowerCLI-Administrator-Cmdlets – Cmdlets for an administrator. Generally speaking, these require read/write access. Example: Clone-VDPortgroup
  • PowerCLI-User-Cmdlets – Cmdlets for users. Ideal for read-only users. Example: Get-VMConsoles

Please use GitHub to send me pull requests for any bug fixes or report bugs. You can of course use comments as well.

Something I forgot to mention in my post on creating modules: If you use the snippets and fill out all the comments, Get-Help Your-Cmdlet will use that information and generate full help files for you. Very helpful!