By Joe Brinkman on 1/1/2008 5:03 PM
I have been a fan of Rob Connery's work on SubSonic for a while now.  As readers of my blog know, I have also been exploring PowerShell quite a bit lately as well.  Recently, I had a need to update a DotNetNuke module to PowerShell 2.0.3.  Unfortunately, some of the APIs had changed between SubSonic 1.x and 2.x.  Because of the desire to keep the module Medium Trust compatible I don't use the build-provider and instead pre-generate my DAL.

In the past I had used the sample web app to generate the classes for just those tables needed for my module.  In this iteration, I decided to go the SubCommander route and generate the needed classes from the command-line.  The SubSonic web-site has a batch file...
By Joe Brinkman on 12/16/2007 11:44 AM
DashboardSeveral months ago I stumbled upon PowerGadgets and have been finding more and more uses for it ever since.  I was initially intrigued by the ability to run powershell scripts but didn't have any immediate needs that required that much power.  One of the strengths of PowerGadgets is the ability to run database queries and then to present the data using very slick graphs, guages and maps.  On Vista, these visualizations are displayed using the Windows Sidebar, however you can also use floating windows which allows PowerGadgets to be equally at home on Windows XP.

My sidebar is now littered with numerous gadgets that I use to show key application metrics, from DotNetNuke Marketplace sales figures to helpdesk work queues. ...
By Joe Brinkman on 10/17/2007 6:36 AM
In my last post Getting a Username/Password in PowerShell (cross posted to PowerShellCommunity.org), I was asked why not just use the Add-Member cmdlet.  Having been doing software development for my entire adult life, this is not the first time this question has come up.  Ok.  Maybe not those exact words, but something very similar - why use code X when code Y does the same thing.  Where I come from there is really only one response to this - look at both code alternatives and determine which one is the most efficient at doing the job without also becoming a maintenance problem.  So lets take a peek under the hood a bit so we can see why I chose PSObject.Members.Add over using the Add-Member cmdlet.

Scripting is code - except on the command line When working in PowerShell I try to keep a clear...
By Joe Brinkman on 10/16/2007 2:06 PM
As part of getting ready for my PowerShell session at OpenForce '07, I am creating a set of helper functions for working with SMO to manipulate and query the database server.  A common need when working with the database is to pass the username and password to various SMO methods.  When I first started coding my examples, I just passed a username and password as parameters into my functions.  This works, but does not exactly look professional when you are sitting in a presentation and typing out passwords in plaintext.

I decided that it would be better to use Get-Credential in this case since it would provide a professional dialog and keep the password hidden throughout the process.  Since I wanted to support both scenarios, I came up with the below function. 

function global:get-sqluser($username="", $password="") { # We are creating an object to which we'll add custom properties $user...
By Joe Brinkman on 10/14/2007 12:26 PM
For the past couple of months I have been playing with PowerShell and it has been a real pleasure to dig-in and get my hands dirty in a command-line interface again.  Not since my early days with the Amiga and ARexx have I enjoyed learning about a new CLI and an associated scripting language.  The PowerShell team has done a great job of bringing windows scripting and the CLI into the 21st century.  Not only has Microsoft been putting in a lot of effort into PowerShell, but you are also seeing an explosion of third-parties who have also jumped onboard to push the new language and hosting environment.  Companies like Sapien, Quest, /n Software, and ShellTools are creating great tools and sponsoring...
By Joe Brinkman on 7/7/2007 7:36 PM
PowerShell Having worked with DotNetNuke for more than 4 years now, I have performed literally hundreds of installations.  While the installation process has gotten easier over the years as we have beefed up the installation routines, it is still not automatic. Even though I can install DNN in under a couple minutes, I often cut corners.  I usually just give the Asp.Net process account full control of the web application folder and use an sa account in the DB.  Neither of these are great practices, but setting up the correct permissions is a little more tedious...
By Joe Brinkman on 6/28/2007 4:04 PM
PowerShell Recently, while working on a new module installer I needed to be able to roll back my test environment as I went through the various iterations.  This was not a trivial installation and therefore I knew that I would likely have to take several stabs at this before I got it right.

Normally, I would turn to either Virtual PC or VMWare in this case.  Unfortunately Vista and Virtual PC were not cooperating today and it was taking forever just to do simple file copies between the VPC and host machine.  Installing the module which clocked in at just over 4Mb took forever.  All of my time savings was being eaten up by a finicky Vista install.  Since I re-paved my machine a few months back I did not currently have a VMWare installation running on this machine so that was not really an option....
Sponsors Minimize
spacer
dummy