13 December 2015

New PowerShell Module for Sortable HTML Reporting -- NewHtmlReport

A couple of years ago, after wanting to make some HTML reports to present tabular data that included a bit of style and interactivity, we created a PowerShell module for such things.  While there are some posts/scripts on the web that address this need in various ways, we wanted an easy to use, straight forward, flexible way.

Now we've added a GitHub repository to house this NewHtmlReport Powershell module project.  The module uses many of the features of ConvertTo-Html, but goes further by adding things like:
  • jQuery and TableSorter support for HTML tables
  • centralized style and script configuration, for uniform results across reports
  • "hightlighting" of rows' values (to bring focus to rows whose values might be of concern, like a datastore usage value that is over a desired threshold)
  • number formatting so as to make report generation even quicker and easier (you can pass your raw data in, and the cmdlets can handle rounding for you)
The are some examples of the output up at the GitHub Pages page for this repository at http://mtboren.github.io/NewHtmlReport/.

Also, check out the ReadMe and the help at the GitHub repo.  And, for the next feature/fix that you desire:  fork it!

15 November 2015

XtremIO PowerShell Module Updated and on GitHub -- v0.9.0 available

XtremIO + PowerShell!Updates and improvements!  Version 0.9.0 of the XtremIO.Utils PowerShell module is now available at https://github.com/mtboren/XtremIO.Utils/releases (starting with the 0.8.x line, this module has been on GitHub). The main focus of version 0.9.0:  providing support for the new object types that came with the XIOS v4 release and its extended API.  See the changelog for the exciting details.

And, if you missed it, the previous v0.8.x releases focused on implementing some PowerShell-y features/functionality, with some great strides in pipelining capabilities of several of the cmdlets.

Note about the changelog and whatnot:  we will be using GitHub as the official home for the module's code, and, so, the changelog available there will be the authoritative source, instead of the copies that we previously hosted at vNugglets.com.  The module's general info page here at vNugglets now holds links to this new home.

22 January 2015

DRSRule - New PowerShell Module for DRS Rule and Group Management

DRS Things
There's a new PowerShell module out, and it is for handling your DRS rule- and group needs!  "Hello, DRS rule/group export and import?  It's me, the new DRSRule module!"  The "why" and the "hows" about the module are further below in this post.

<vNugglets_note> I got to work with the PowerCLI master, Luc Dekens, on this module -- what a treat! (Check out his post about the new module at http://lucd.info/drsrule-drs-rules-and-groups-module)  It was a great learning experience for me, not only on the PowerShell/PowerCLI tip, but also on topics like collaborative/concurrent development, GitHub features (organizations, releases, etc.), and more.

The cmdlets from the module are solid as one would expect:  pipeline support, value by object or name, WhatIf support, and so on.  As for using some of the cool features of PowerShell, the module includes things like advanced/custom type support (including enabling tab-completion of properties later in the pipeline; handy), XML-based external help as manufactured by https://pscmdlethelpeditor.codeplex.com/, and leveraging other object storage formats so as to simplify handling/export/import of rich objects (via JSON) -- just a few of the great features/bonuses by Mr. Dekens. </vNugglets_note>

Now, more about the module.

Why the DRSRule module?

The core PowerCLI PSSnapin from VMware allows for many of the DRS rule operations that one might want to perform.  There have been questions over the years in the VMware Communities PowerCLI forum about how to export DRS rules and groups, and, on how to then import such items.

While there are several posts on the web about how to get/export such things, importing/recreating DRS rules/groups from such exported data has not received much focus.  This was the spark for this DRSRule module:  to allow for easy export/import of such rules/groups.  As part of making a module to handle these actions, other cmdlets were born, like the Get-/New-/Remove-/Set-* cmdlet sets for DRS VM groups and VMHost groups, along with sets for DRS VM to VM rules and VM to VMHost rules.

How to use the DRSRule module?

The DRSRule module comes with an about_DRSRule.
Once the module is installed, use that help topic to get a general introduction to the use of the DRSRule module:
Get-Help about_DRSRule

How to get the DRSRule module?

The source for this PowerShell module is hosted on GitHub.com.
The repository is managed by the GitHub organization "PowerCLIGoodies", and the repo itself is at https://github.com/PowerCLIGoodies/DRSRule.

There are a few ways to get the module, and use it in your PowerShell session:

    Automated

    Via a script
    Use a PowerShell script to perform the download and the extract.
    The script is included in the repository as file DownloadLatest.ps1.

    Via PsGet
    If you have the PsGet module loaded in your PowerShell session, then installing this DRSRule module is as simple as updating PsGet and then installing DRSRule:
    Update-Module -Verbose -Module PsGet
    Install-Module DRSRule

    Manual

    Grab the .zip file of the latest release from the GitHub repository.
    Extract the content to a suitable folder.

    You can go for the Modules folder linked to the Windows account you are using.  To find this path, run:
    Join-Path ${env:\userprofile} "Documents\WindowsPowerShell\Modules"

    Or, you can select any other folder you desire.

    Either way you will end up with a folder named [PathToModule]\DRSRule, in which the PowerShell files for the DRSRule module reside.

    Then, load the DRSRule module into your session:
    If you selected one of the folders in $env:PSModulePath (your PSModule path), you can do this with
    Import-Module DRSRule

    If you picked another folder, you should use the full path to the folder that contains the module's files, like:
    Import-Module [PathToModule]\DRSRule

    Please also read the note below about using Unblock-File, since this module is not Authenticode signed

Note on Unblock-File

This section pertains to using the Manual method above to get the DRSRule module (downloading .zip file).  Since there is no Authenticode certificate supplied for this module, and, assuming that one's PowerShell ExecutionPolicy is at least RemoteSigned, below is a quick/easy way to unblock files.  But, this should only be done when you trust the code in the files that you are unblocking -- inspecting the files is for your own good.
Get-ChildItem [PathToModule]\DRSRule | Unblock-File