Powershell

(edit: be sure to read the comments…and check out the Update-Tools cmdlet!)

If you already have the VM Tools installed in your guest OS, the VI Client gives you the capability to do an automated upgrade, provided the tools are of a recent enough version (3.0? 3.5? not sure). The VI Toolkit is the awesome, but there is no cmdlet included to kick off an upgrade.  Luckily, it’s not hard to do.

Get-VM | % { (Get-View $_).UpgradeTools_Task($null) }

 

Note that the “%” is alias to the Foreach-Object cmdlet, and that even though the SDK docs say that the parameter to the UpgradeTools_Task() method is optional, I found it only worked if I stuck something in there.

The VM object returned by Get-VM doesn’t have any cool methods on it because of the way that VMware adapted the types for the administrator (you). But if you use Get-View on it, you’ll be able to use any method which is available to the “managed object”. Here’s a quote from their VI SDK about Managed Objects:

A “managed object type” is a core data structure of the server-side object model. Instances of various managed object types are referred to generically as “managed objects,” of which there are two broad categories:

  • Managed objects that extend the ManagedEntity managed object type, and thus, are components that comprise the inventory of virtual components. For example, instances of datacenters (Datacenter), host systems (HostSystem), and virtual machines (VirtualMachine) are inventoried objects, and are referred to generically as “managed entities.”
  • Managed objects that provide services for the entire system. Managed objects in this category enable managing performance (PerformanceManager), managing licenses for VMware products (LicenseManager), and managing virtual storage (VirtualDiskManager). These managed objects are the service interfaces for the virtual infrastructure management components.

Be sure to check out the SDK reference guide If you want to learn more about the VM managed object or the UpgradeTools_Task() method.

Powershell

image You can find all the details and download links on Dmitry’s PowerBlog.

Most Active Award ($500) – Adam Murray for his incredibly comprehensive SQL Server 2005 Reporting Services powerpack.

Second Most Active Award ($250) – Quintus Jones III who submitted two great powerpacks: Citrix and File Server management.

And finally… Best PowerPack Award ($500) – Jonathan Medd’s Exchange Server 2003!

Well, I think it’s really him. I can dream.

It started with a notification from Captain Hammer that the soundtrack for the awesome Dr. Horrible’s Sing-Along Blog was up on iTunes (warning: link will open iTunes):

image

I reply and refer to a line from the show:

image

His reply:

image

That’s ok, it’s early yet, so I remind him who the hammer really is:

image

And then I receive a message showing what can only be Nathan Fillion’s true self:

image

:D How cool is that?

Powershell

Tomorrow night at 9pm Eastern, Jonathan and I will be streaming live over Ustream. If you think you’ll make it, and you use Facebook, I’d really appreciate it if you sign up for the event I created. 

Powershell

This will perform a basic netstat.exe command and “objectize” its output. This version only handles the TCP stuff because I ran out of time. This needs perhaps a switch statement and a second regex to do the rest justice. Also, I’d like to see in a v2 the capability to tie process names in via the PID column and output the real process name and file info and so on.  If you want to hack on it, just click on the PoshCode link below the script listing and update it in place.

Here is an example showing the obvious benefits of turning screen output into an object:

image

Powershell Windows

And it is back in style. Tomorrow morning (Aug 25th), the new beta for PowerShell Plus Professional 2.0 will be officially released, and it is HOT. Tobias has been working extremely hard over the past several months adding new features and tweaking the UI. He has put out an application which is very nearly perfect. I’ve had inside access and have been watching 2.0 extremely closely ever since 1.0 was out the door and I imagine he could not be more pleased and excited to be able to finally show everyone what he has been working on.

Go check it out for yourself and download the beta over at Idera.com. Here are a few screenshots to whet your appetite.

image

image

image

image

2008-8
20

Normally I wouldn’t bother to highlight a spammer, but with powerful tools available to prevent blog post spam such as Akismet and Bad Behavior, the only spam I get lately is stuff that is manually posted by hand, or from some new bot which hasn’t been profiled yet.  And of those that do make it, the destination URLs are so obvious that nobody (intelligent) would click on it anyway.

New comment on your post #77 "Episode 35 – Community Roundtable #2"
Author : podcast directory (IP: 98.148.145.202 , cpe-98-148-145-202.socal.res.rr.com)
E-mail : webmaster@www.podseek.net
URL    : http://www.podseek.net/
Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=98.148.145.202
Comment:
Couldn’t have said it any better

Now, some may wonder how I can be sure that this is spam.  I mean, it appears to be a podcast directory which is commenting on a post about a podcast. I have to give them credit for the blog bot (or person behind it) choosing a somewhat relevant post, but in reality there are some red flags:

  1. The email address.  Nobody uses as their personal email address “webmaster@”.  And for that matter, nobody uses an email address with a hostname which begins with “www.”. However, this is not reason enough to kill this comment.
  2. The comment itself, “Couldn’t have said it any better”.  I can’t tell you how many times I have seen this exact text in spam comments on my blog.  It’s canned text from a blog spam bot, and it’s not very convincing.
  3. The google search “link:podseek.net” has 46 hits, many of them from the same site.

So anyway…don’t support a site which resorts to this strategy please.  And I hope this mini-rant helps you to detect spam in your comments in case you had some ambiguous ones.  And be sure to use anti-spam tools on your blog!

(Hyperlink removed from above…please don’t link there, they do not deserve it.)

Windows

I really didn’t think much of the Sideshow feature when I had first heard about it. But that was before I saw this:

This is very cool – you can use your Windows Mobile device to control your Powerpoint slides via Bluetooth.  It basically combines the Windows SideShow for Windows Mobile preview with a SideShow gadget for Powerpoint.

To do this you will need two components:

  1. Windows SideShow for Windows Mobile Developer Preview
  2. Office PowerPoint Remote

Man, this would be awesome for doing presentations! That’s it, I gotta rebuild my laptop.

(via MR Mobile)

Powershell

I was surprised this morning to find that you can’t directly move templates using the existing cmdlets.  Looks like you can either a) change template to a VM using set-template or b) use Get-View on a Folder object and then call its MoveIntoFolder_Task method.

Method A – there and back again

   1: $vm = Get-Template wind* | Set-Template -ToVM |
   2:     Move-VM -Destination (Get-Folder templates)
   3: $vmView = $vm | Get-View
   4: $vmView.MarkAsTemplate()

TotalSeconds      : 8.9222029

Method B – do it folder style

This one should be much faster…let’s see:

   1: $TmplView = Get-Template wind* | Get-View
   2: $FolderView = Get-Folder Templates | Get-View
   3: $FolderView.MoveIntoFolder( $TmplView.MoRef )

TotalSeconds      : 2.0466224

We have a winner :)

Note that I didn’t actually use MoveIntoFolder_Task(), I used just MoveIntoFolder().  The former will create a task and queue the operation, returning control to your script immediately. That’s good for some things but not for the purposes of measuring the timing.  :)

Also note that the timing was performed on my home lab.  I imagine on nice hardware method B would take less than a second.

Powershell

From the Episode 37 show notes:

Contest

We have two copies of Netcmdlets to give away this week.  Prizes will be awarded on Episode 38.  All you have to do to win is be one of the first two people to send in a script that uses the Netcmdlets OR a PowerShellASP page.  You can use their “hobbyist” license to get the job done.  And don’t send in a little single statement one-liner–give us a few lines of code at least.  :)   All entries become the property of the PowerScripting Podcast, some rights reserved, do not taunt happy fun ball.  (Just kidding, we’ll publish all entries on the website.  But seriously–don’t taunt happy fun ball.)

We decided to up the ante and we’re also giving away a copy of SAPIEN’s excellent PrimalScript 2007 Enterprise editor / IDE.  Send your scripts to feedback@powerscripting.net today!  If we get a lot of entries then I may have to keep adding prizes to give away.

Deadline is this Sunday 8/17/08.

  • Microblog

  • Recent Posts

  • Recent Comments

  • meta

  • PowerShell Blogroll