More than one way to do it, Part I - Powershell

So my coworker, err boss :) seems to have started playing with Powershell, which is great.  It looks like his first foray into PowerShell development is a commandlet for tibco ems topics.  My initial feeling on this is that the benefits of commandlets syntax checking are not worth the tax of compiling and installing it. I would've used a native PowerShell approach. On the other hand, a full navigation provider...

function Get-TibcoTopic([string]$topicName, 
                        [string]$url="tcp://localhost:7222", 
                        [string]$username="admin", 
                        [string]$password)
{
    $null = [Reflection.Assembly]::LoadFrom("C:\tibco\ems\clients\cs\TIBCO.EMS.dll")
    $null = [Reflection.Assembly]::LoadFrom("C:\tibco\ems\clients\cs\TIBCO.EMS.ADMIN.dll")
    $admin = new-object TIBCO.EMS.ADMIN.Admin -arg $url, $username, $password
    $admin.Topics  | ? { $_.Name -eq $topicName } 
} 

But I am seeing this a lot with myself and coworkers around new technologies. I guess the first step in learning a technology is getting something that works, and the second phase is getting something implemented the right way. For me, I'm struggling with WPF. I wanted to implement a bullet graph image and do with the right way so that if I wanted a more traditional gauge approach, highway just need to swap out the template. I couldn't get it to work so I switched to implementing the control as the panel. It feels wrong, and I know I'm going to run into trouble with it shortly, but at least it works.

1 Comment

  • Slowly but surely ....

    I wanted to find out how to write custom cmdlets, so this was a very gentle intro. As I get my sea-legs, I will venture into creating new functionality totally in PS.

Comments have been disabled for this content.