24 October 2016

RIP Oscar (2003-2016)

He was my good boy, my companion for 14 years.  He never asked for much except for some loving belly rubs and the occasional ball to chase down the hall.  He was no saint, forcing me to move our gutters in front of the back yard fence.  There was not a gutter safe when Oscar thought there might be a chipmunk hiding in there!  He was no saint, but he was my good boy.
At times he could let out the stinkiest gas you've ever smelled, but have him sleeping on your lap and you let one out... he'd look at you all disgusted and then hop down and walk away in a manner of disgust that only Oscar could pull off.
He was always with me, ever present.  Our morning routine was "Let's go to work boy!" and he'd trot along with me down to the basement and lay on his pillow next to my desk all day long.

Like so many things in life, his time was too short.  We laid him to rest yesterday morning and the grief still wells up behind my eyes frequently.  I'm going to miss him so much, my good boy.
Thank you Oscar.
Thank you my good boy for 14 great years of selfless love and joy.


Oscar having ice cream.


Oscar belly deep in the basement flood.


Ready to work dad!


I'm exhausted!


I have no idea where that came from dad.


Hey dad, you stopped scratching my belly.


I love my Ouma!


Boy I love my naps.


Ahhh, the fruits of my labor...


Whacha talkin 'bout dad... hole, what hole?  You can't prove a thing!


Let me at 'em dad!  I'll get that chipmunk!
https://goo.gl/photos/kosNBQUewRYkzKbk7

Of course, his #1 favorite was to kill squeaky toys!
https://goo.gl/photos/pc79D6kyeMPZCY3A6


Thank you my good boy.
Thank you for 14 wonderful years.
THANK YOU!!!

17 October 2016

Powershell - Super commands [Invoke-WebRequest]

If you've been playing around with Powershell modules, you've undoubtedly run into the problem of keeping your modules, deployed all over the place on multiple servers, up to date with the latest version.  Powershell scripts and modules don't normally fall under traditional application life-cycle management (ALM) processes, so unless you/your organization apply targeted and specific effort toward managing these objects via ALM, you know what a pain mismatched versions can be.  We can save the debate over ALM for another day, but the simple fact is, that keeping scripts and modules updated can become tedious.
In my world, I've addressed this problem through the use of an updater module and the very powerful cmdlet called "Invoke-WebRequest".

Invoke-WebRequest is documented here:
https://msdn.microsoft.com/en-us/powershell/reference/4.0/microsoft.powershell.utility/invoke-webrequest

I built a command line app to generate my Powershell script body with all the components I normally use.  Part of these components is the loading of the updater module.  Once the script has checked that it's running with admin rights and the updater module is loaded, the method in the updater module is called to ensure that the main module is up to date with the latest version.  The updater module simply makes a call to Invoke-WebRequest like this:

C:\> Invoke-WebRequest -Uri http://www.sharepointmvp.net/ulsviewer.zip -OutFile C:\data\UlsViewer.zip

The above example simply pulls a zipped copy of ULSViewer down from the internet, so you can test it for yourself.  In my case it looks something like this:

C:\> Invoke-WebRequest -Uri http://master-server/Utils.psm1 -OutFile C:\Program Files\WindowsPowerShell\Modules\Utils.psm1

This will update the module which is then loaded into the script to provide all the latest features of the script.  Now it's important to understand the potential security risk of doing this.  The master-server location of the module has to be well protected and tightly controlled.  Failure to do so, could result in someone planting some malicious script code into your module and then distributing it to all your servers.  Remember that convenience and security are polar opposites.  When you increase one, you necessarily decrease the other.

Nevertheless, through this implementation, I am able to manage a central source module for my helper methods that is then re-used in all my scripts.  Fixing a bug once, fixes it everywhere.  Conversely, breaking a method in the module once, also breaks it everywhere. :-P

I'm sure you can come up with many more useful ways of using Invoke-WebRequest.  Let me know in comments about some of your favorite ways to leverage this powerful cmdlet.

Later
C

Microsoft Authentication Library (MSAL) Overview

The Microsoft Authentication Library (MSAL) is a powerful library designed to simplify the authentication process for applications that conn...