GET-UPDATE | SEND-READERS

Powershell

For those of who have been loyally reading the blogs you’ll have been staring at what appeared to be an almost dead page.

Did the world fall apart?   Did Starbucks run out of Coffee?   Did “The Kraken” get tamed?

All valid questions.  Normally I find I blog and twitter like a madman.  As thoughts flow in my head, they get dumped out.  

So what happened?  An amazing and INCREDIBLY cool month!  Of course a busy one to boot at work.

First off, the month started off with a bang, as many of you are aware; I was nominated and received the Microsoft MVP award for Windows Powershell.   That just sent me spinning!  I was floored.  Smiling like and idiot, beaming everywhere at strangers for no reason.

Getting funny looks from my co-workers.

Then of course during the entire month of April was EVENT after EVENT after EVENT!  Energize IT 2010 occured here in Toronto as well as the normal ITPro Toronto meetings.  Tap that into my normal 15 hour day of work and commute and my schedule over floweth!

But then another piece surfaced.  I needed my passport!  A good friend advised me to sort that out since (in his words) “It would be a shame if you had to refuse presenting somewhere really cool just because of that”

Yes, a new passion lit inside of me.  For some silly reason, I now LIKE to present!  Standing in front of a crowd to see if they pull me off the stage.

So my passport needed to be renewed.  Something I haven’t done in … well a long enough time that it was a headache.   It took several booked appointments, finding the right paperwork and isolation from work without my cell phone during that time.

It is done.  Sorted out.  Which means I can now go to the one conference I have been waiting FOREVER to go to.  Microsoft TechEd 2010!  People thought I was “over the top” with Techdays here in Canada?  You’ve not seen nuthin’!

The month of April has quieted down and the following year is about to tear loose 🙂

So what does this all mean?   The Energized Tech is back and you know what that means.  I’m out, and it’s time to…

“Release the Kraken”

Sean
The Energized Tech

The 2010 Scripting Games are afoot!

ScriptingGames

April 26th is here and the Scripting Games are back!

Do you feel the power coursing through your keyboard?  The ability to breathe Powershell or vbScript is second nature to you?

Then take up the challenge!  Go today to http://2010sg.poshcode.org and sign up and take the challenges in the 2010 Scripting Games!

Take up the cause and seize the day.  The Scripter is in you!

Sean
The Energized Tech

Powershell – Create a Common Powershell Profile for all Network Users

Powershell

This article was initially intended for Network Administrators.  For a large corporation that wanted to standardize their Powershell setup.

Then I realized others could benefit from this.

If you’re aware of it, in Powershell there is a file based upon your Shell called your Profile.  Powershell ISE has it’s own Profile.

All the profile IS is just a BIG dumb text file you can fill with Powershell commands, functions, settings.  Nothing more than that.

It’s typical location is sitting on %USERPROFILE%My DocumentsWindowsPowershell and is usually called Microsoft.Powershell-profile.ps1 or Microsoft.PowershellISE-profile.ps1

And it’s format is just like a PS1 file.  No real difference.   But typically you’ll fill it with functions rather than Executing programs.  But you can use yours however you want.

My task today is to show you how to create a standard profile and pass it along to other administrators.

The easiest way is to just edit your profile the way you want and store is on a network location.  Name it something unique like “OURSTANDARD.PS1”

So “assuming” we have placed the file OURSTANDARD.PS1 on a common share like \ASERVERABADLYNAMEFILESHARE all you need to do is create a NEW shortcut for Powershell launched with the following Parameters in Windows

“%SystemRoot%system32WindowsPowerShellv1.0powershell.exe -noexit -command ". ‘\ASERVERABADLYNAMEDFILESHAREOURSTANDARD.PS1’”

There! You’re done.  You only need deploy a standard Powershell Shortcut to your Network Administrators rather than trying to keep the latest profile passed about. 

And if you’re looking for a Standard Profile to work with?  Here’s something it could look like

—————– Start Profile Here ————————————-

# ABC DEF Ernie Gonzo and Cookie Monster Powershell Corporation
# Commented out so nobody can see this

FUNCTION GLOBAL:GET-PRAISE ( $Name ) { WRITE-HOST “$Name is the Greatest Administrator on the Planet!” }

WRITE-HOST ‘ABC Corporation – Powershell Administration Console’
WRITE-HOST ‘’
WRITE-HOST ‘Use GET-HELP to errrrrr….. well to GET-HELP’

————- End Profile Here ——————————————

Ok this profile is lame, really lame, COLOSALLY lame.   A little message on the screen and a new Function you can type called ‘GET-PRAISE’ to make yourself feel good.

But that’s all your profile is!  You can predefine Global functions (which could be standard Powershell scripts your normally use), common domain servers predefined or any number of things.

It’s only limited by your imagination.  And it’s easy to standardize and control. And remember…

The Power of Shell is in YOU!

Sean
The Energized Tech