December 19th, 2010

Weekend Scripter: Holiday PowerShell Carol, Part One

  

Summary: Holiday Windows PowerShell Carol, Part One in which Ebenezer forces Bob SnipIt to use VBScript.

 

Microsoft Scripting Guy Ed Wilson here. It is almost the end of the year and we have decided to devote some posts to the holiday season. We even have guest bloggers from around the world to share some holiday spirit. Today we have Sean Kearney who is a Microsoft Windows PowerShell MVP from Canada.

Sean Kearney is a Network Administrator, Microsoft Certified Technology Specialist in Windows Server Virtualization, Configuration and Microsoft Certified Systems Engineer and overly enthusiastic member of the IT Community. He is also a retired “Friday Funny Guy” (but he won’t speak of those days when prompted, or the many songs, or the Serenade to Steve Ballmer).

He is a devoted and passionate computer enthusiast from the early 80’s to the present day, having used just about every microcomputer ever. He is self-taught in computer programming with 65xx machine code, working with many technologies, but primarily Microsoft. He deals with “anything thrown at him” from gnawed keyboards to recovery of Exchange servers, to networking setups and isolating the realm of the unknown.

His present position has him testing and deploying just about any new Microsoft Technology he is asked to in addition to dealing with users in an Enterprise-Class environment. Before this, he spent over 8 years dealing with Small Business Systems and home user environments.

He absolutely loves Windows PowerShell, Windows 7 and Hyper-V in that specific order. When people mention the word “Microsoft” to him in public he claims that his eyes light up. Or it might be all the coffee drinks, we’re not sure.

Rumor has it he thinks he is the long lost twin to a “certain CEO” at Microsoft. Without further ado, here is the first installment of A Windows PowerShell Carol. Make sure that you also check out the video Sean made to accompany the Windows PowerShell Carol series of holiday posts.

 

A Windows PowerShell Carol

Clippy was no more, of that it was certain.

Ebenezer went into the drawer of his former assistant and removed the last two snippets of VBA code he had left behind.

“There’s no code where’s he’s gone,” he muttered coldly under his lips.

([DATETIME] “12/24/2003”).addyears(7)

 # For those of you regular folk, this is 7 years AFTER this date 🙂

‘Twas seven long, cold years since Clippy’s leaving. Ebenezer Script sat in his office, unhappily editing an old VBScript. He is busy removing comments from the code to make it more difficult to modify.

A bitter and grumpy Admin, he spat out foul words whenever the users walked by. His haggard old ways clung to VBScript and he refused to learn anything new. He is sitting with his only friends in the world, a CGA monitor and 286 CPU while staring at the world through closed and darkened functions. He hates new things. Oh yes, and sound cards, especially sound cards. Stereo Adlib cards are the worst.

Did we say Ebenezer was Grumpy? I think that you get the point. The seven years since his assistant Clippy left have taken their toll. (Not the good “cookie” kind either.)

And so it was, on a bitter December day, he stared across the room at his willing but tired Co-Op student, Bob SnipIt. He stared at the happy little fellow with spite. Nothing could make Bob unhappy which made Ebenezer even MORE unhappy. Bob was ALWAYS beaming with his big glasses and giant smiling face.

Bob was a cheerful little fellow, spending all day in the corner by himself, quietly reading up on Windows PowerShell and Windows 7. He would secretly write little Cmdlets unbeknownst to old Ebenezer. Occasionally Bob could be found singing the odd song, albeit sometimes very loud and off-key. Occasionally he would launch a massive résumé blast at a little office in Redmond just for fun. Sometimes, he would spend the time dreaming of the day…

“Mr. Script,” Bob piped up one morning, “I was wondering, since the weather is rather merry, if I might have the day with my family. I could use a Windows PowerShell Cmdlet to make things mo…”

“BAAAAHHH!” Ebenezer spat out. “CodeBug! VBScript is the only words I shalt hear out of your mouth young one. If you INSIST on taking the day, you shall do it only if you add these numbers so I can submit them to an auditor tomorrow.”

Bob quickly popped open a Windows PowerShell window and keyed in the numbers directly.

10+65+76+98

Ebenzer looked over. “BAH! Codebug! I want it DONE in VBScript! Don’t you throw this new nonsense at me! VBScript is the ONLY way to go! Baaaahhhh!” he bleated loudly.

Bob’s jaw dropped. In VBScript? And so poor Bob sat about his task, opening up notepad.exe he began to type until Ebenezer spat out.

“BAAAAH! None of these fancy tools!  NO EDITOR! DOS ONLY!!! Baaaahh! Codebug!” the old mizer cackled madly.

“No Editor?” Bob thought glumly as he started up CMD.EXE and typed in:

COPY CON: C:\vbScript\Addit.vbs

How his heart sank, typing in the lines, doing a CTRL-Z as he made mistakes to re-create the file. Until finally…

DIM RESULT

   RESULT=10+65+76+98

Wscript.Echo RESULT

And terminating with a final Ctrl-Z,

he ran the VBScript with a:

CSCRIPT.EXE C:\vbScript\Addit.vbs

to have Ebenezer see the results.

The old mizer glanced at the results. Disdainful and unhappy to see young Bob produce good output, another “BAAAAHH!” left his lips.

“Fine, you take your day off, be Merry. You’ll need it. For I shall be ten times more miserable tomorrow and with MORE VBScript for you to write! I’ll pull off the ENTER key, too! Baaaah! Codebug!”

Young Bob SnipIt left the office that day, tipping his hat to Mr. Script. “Happy Holidays to you, Sir! May they be joyful!” as he bounded out the office humming a holiday Windows PowerShell tune.

“BAH! Codebug! Windows PowerShell indeed!” Ebenezer hobbled back to his desk to finish the day removing efficiency and comments in code. “I’ll make him do it in PERL tomorrow!” he mumbled under his lips.

Was old Ebenezer always such a Grumpy Admin? Will Bob ever convince him to use Windows PowerShell? Will the writer manage to come up with some witty and interesting way to catch your attention without drawing the lawyers for the estate of Mr. Charles Dickens? Will Clippy suggest anything interesting?

Join us tomorrow for the next Episode of “A Windows PowerShell Carol

Hope that you enjoyed our holiday post today. Thanks Sean, I am looking forward to tomorrows post.

I invite you to follow me on Twitter or Facebook. If you have any questions, send email to me at scripter@microsoft.com or post them on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

 

Ed Wilson, Microsoft Scripting Guy

Author

0 comments

Discussion are closed.