Monthly Archives: May 2016

Get-View | Show-Object

I was recent watching a PowerShell presentation where they mentioned a cool module called PowerShellCookbook and in particular discussed a cmdlet in it called Show-Object by Lee Homes.  I instantly knew how perfect and powerful it would be with VMware’s PowerCLI Get-View.

Bare with me for a minute while I lay the ground work with Get-View.  If you’ve ever used Get-View in PowerCLI you’ll know that it brings back a ridiculous wealth of information.  When you run a cmdlet like Get-VMHost it’s really only bringing back a small subset of information back on that object.  Sometimes this is fine but sometimes we need that little bit extra to reach our objective.

For example you can run Get-VMHost esxi01.ukoticland.local

Windows PowerShell ISE-000282

What you get is a default formatted table view displaying only a few key values.  A trick some of us do is then pipe this out to a list.  Get-VMHost esxi01.ukoticland.local | Format-List

Windows PowerShell ISE-000283

Heaps more information right, but it’s still not the full picture.  There’s still a lot of information on this object that we’re missing.  Take the original cmdlet we ran above and this time let’s pipe it to Get-View.  Let’s also store it in a variable called $myHost, just so we can work with it.

$myHost = Get-VMHost esxi01.ukoticland.local | Get-View

Windows PowerShell ISE-000284

Okay, on first glance it doesn’t look like much.  But all those values that start with VMware.Vim are properties that can be drill down into.  For example $myHost.Config and $myHost.Config.Capabilities

Windows PowerShell ISE-000288

So it’s pretty cool right.  We can now start retrieving a huge amount of new information that wasn’t available to use before.  But this is like finding a needle in a haystack.  I know I’ve wasted so much time typing $something dot something dot something in the hopes of finding a value I can work with.

Well finally this brings us to Show-Object.  This is an awesome cmdlet that will let you display the object retrieved with Get-View in a grid view window that you can navigate through similar to a directory in File Explorer.  Using it is as simply as piping our variable to Show-Object.

$myHost | Show-Object

Windows PowerShell ISE-000287

Now we can explore and click around at everything available to us.  As you navigate the object in the top pane for results you’ll get member data in the bottom pane.  I see this becoming a great reference tool to help find what you’re looking for.  Not only that but it will give you the syntax to retrieve the information selected in the view pane.

So how do you get Show-Object?  Well, it’s not in PowerShell by default but can easily be obtained from the PowerShell Gallery, which, if new to you, is basically a public repository for PowerShell content.  If you’re using Windows 10 you’re half way there.  If not go get yourself the Windows Management Framework (WMF) 5. This will give you the latest version of the PowerShellGet module.  Then it’s just a matter of typing Install-Module -Name PowerShellCookbook.

Once the module is installed from the PowerShell Gallery, Show-Object is now available to use.  It’s worth noting that PowerShellCookbook comes with a huge array of extra cmdlets also worth exploring.

Finally if you do try out Show-Object and like it, there’s a “jacked up” version of it over at PoshCode by Justin Rich

 

Melbourne VMUG, Stronger Than Ever!

Held this week was the quarterly Melbourne VMUG.  The location was sponsored by Telstra, as it has been for a little while now, in one of their conference facilities in the CBD.  Telstra have shown to be a great supporter of the Melbourne VMUG with the continual use of their facilities.

I’ve been semi regular attendee to the local Melbourne VMUG for quite a number of years.  So it’s a great privilege to have now become a committee member.  I’m still very green to the role and learning the ins and outs.    What I can say so far is that it’s run by a great bunch of guys committed to putting on the best event possible.

The Melbourne VMUG is an awesome event, hands down.  Where as other user groups run very regular meetups (monthly).  The Melbourne VMUG has taken a quality over quantity approach.  We run a large annual UserCon at the beginning of the year plus another three regular meetups throughout the year.  In between the meetups we run vBeers where like minded people can just sit and chat over some drinks (Beer).

We’ve now reach a point in the Melbourne VMUG where we can comfortably run two tracks side by side at our regular meetups.  Our May meetup had some great sponsors and some of the best content I’ve seen -with some great prizes to boot.  Our first session had vendors HP and Runecast presenting.  I sat in on Runecast and was really impressed on what they have to offer.  Our second session was VMware.  We had Chris Garrett talking about everything new in vSphere 6.0 Update 2 and Kevin Gorman talking containers.  I sat in on Kevin’s preso.  Kevin puts on a great talk and is a really great guy to listen to. The last session of the night was allocated to community speakers.  We had the leader of the Melbourne Docker User Group, @benitogriffin, present and an awesome Panel Session on Home Labs.  Okay, I may be a little bias on this last one.  I was one of the four panelists.  That’s me on the far right.

CiQB3WQU4AA8KAf

The night didn’t end there.  We had vendor sponsored vBeers and pizza at Troika Bar.  A cool little bar around the corner covered in what looked like aluminum foil that made you feel like you in a satellite or something.  A great end to the night where everyone could wind-down and talk about that awesome Home Labs panel session that I was in 😛

CiQC8gtU4AA8bKN

Recently on social media there was discussion going around on how to make VMUG great again.  People comparing VMUG of the past to what it is today.  I was a little disappointed to read some of the comments.  VMUG certainly isn’t what it use to be.  That doesn’t make it worse… just different.  Just like in IT things change and we have to adapt and change with it.  If you feel you need to make VMUG great again look no further than the Melbourne VMUG.  Best VMUG  Ever

Links

VMUG Homepage
Melbourne VMUG Workspace