« Is Open Source a Crap Idea? | Main | The "Do My Slides Suck" Test »

Loving Mush - I mean Monad

Posted 2006-03-23 01:46 AM in PowerShell | Watir | Ruby | TechEd | Speaking | PDC | XML.

Microsoft Command ShellMaybe if I call the Microsoft Command Shell "mush" enough, it will catch on. MSH, or "Monad" is on my mind lately (again, after a quick and ill-timed dismissal at PDC), thanks to Keith Hill and the wealth of MSH bloggers out and content there. We did the Monad show, but this little shell is no fly-by-night. It's changing (changed?) the face of Windows Administration.

Just as the .NET Framework was "managed spackle" over the chaos that is the Win32 API, just as WinFX cleans it up even more, MSH (IMHO AFAIK if I can abuse the TLAs a bit) is a stunningly clean and well-thought out abstraction layer on top of everything.  To quote Arul: "Monad is the only scripting platform that provides access to .Net, WMI, COM in a well-integrated manner."

It's a shell, in the complete sense, but it's an engine for scripting everything that is already on your system. I'll post more about cool MSH Analyzer is and how you can host Monad in your own Admin applications later.

Here's the links from this week's Hanselminutes, but I'll add more and more at my del.icio.us feed for MSH.

 Pithy and Readable? Do tell!
MSH Wiki @ Channel 9
Monad Team's Technology Blog
Dan Sullivan msh+SMO
Sample Monad-MSH Scripts
Using-Culture -Culture culture -Script {scriptblock}
MSH Analyzer - it is born.
Monad Scripting Center
Getting MSDN help urls for .NET BCL types and Members
viveksharma.com: techlog
Keith Hill's Blog
A guided tour of the Microsoft Command Shell by Ryan Paul
Jeffrey Snover's Monad TechEd Presentation by Webcast
MSHVSS Provider 

Here's some "mush" examples that are fun to read and might give you a tiny taste of what you can do:

Download a feed and list the RSS Enclosures:

$url = "http://feeds.feedburner.com/ScottHanselman"
$feed = [xml](new-object System.Net.WebClient).DownloadString($url)
$feed.GetElementsByTagName("enclosure") | format-list

Find out about your system:

get-wmiobject win32_processor

Get a list of currently loaded Assemblies

[appdomain]::currentdomain.getassemblies() |ft fullname

Listing the currently open Explorer Windows

(new-object -com "Shell.Application").Windows() | select LocationName, LocationUrl

Open an IE window and navigate (smells like Watir...)

$ie = new-object -comobject Internetexplorer.application
$ie.Navigate2("http://www.microsoft.com")
$ie.visible=1

Get the latest Event Log entries:

get-eventlog Application -newest 100 | sort source

I encourage you to check it out. The learning curve is a little high, but at some point it "pops" and you're having a blast.

Tracked by:
"Monad on Hanselminutes" (Arul Kumaravel's WebLog) [Trackback]
"Introducing Readify's MSH script site." (notgartner.com: Mitch Denny's Blog) [Trackback]
"Sick Shell Humor" (IImplement) [Trackback]
"Loading Visual Studio 2005\.NET 2.0 SDK Tools (vsvars32.bat) in Monad (MSH)" (j... [Trackback]
"Meet Monad - your new best friend" (Darren Gosbell's Random Procrastination) [Trackback]
"Meet Monad - your new best friend" (Darren Gosbell's Random Procrastination) [Trackback]
"Monad - next version of Microsoft Command Shell..." (Rexiology::Work) [Trackback]
"Monad - next version of Microsoft Command Shell..." (Rexiology...) [Trackback]
"Monad/MSH/Powershell What's in a name" (Darren Gosbell's Random Procrastination... [Trackback]
"Monad should rock your world!" (Low Country Software Ramblings) [Trackback]


Thursday, March 23, 2006 6:28:41 AM (Pacific Standard Time, UTC-08:00)
WMI seems to be one of the most powerful but underused technologies available to developers. I think part of the challenge is that its difficult to find out what is available (what the object and property names are).
I recently discovered the Scriptomatic 2.0 tool, which completely blew me away.
http://www.microsoft.com/downloads/details.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178&DisplayLang=en

Suddenly the huge wealth of information available via WMI was actually accessible.

I've also been impressed with MSH, but had the same feeling of being overwhelmed. I'd love to see a new version of Scriptomatic that generates msh scripts...
Thursday, March 23, 2006 8:23:24 AM (Pacific Standard Time, UTC-08:00)
It's on the way, Josh :)

Also -- although Monad supports WMI at the moment, we do have plans to make it more discoverable.

Lee
Thursday, March 23, 2006 9:04:35 AM (Pacific Standard Time, UTC-08:00)
Hah,

In my hometown 'mush' is slang for a friend!

"Well mush, how's it going?"
"Not too bad mush, yourself?"

:)

Best regards,
Derek
Comments are closed.

Contact

Sponsors

Hosting By

Hot Topics

Tags

Calendar

<November 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

November, 2009 (5)
October, 2009 (19)
September, 2009 (11)
August, 2009 (12)
July, 2009 (21)
June, 2009 (26)
May, 2009 (16)
April, 2009 (13)
March, 2009 (17)
February, 2009 (17)
January, 2009 (18)
December, 2008 (32)
November, 2008 (17)
October, 2008 (22)
September, 2008 (16)
August, 2008 (14)
July, 2008 (25)
June, 2008 (19)
May, 2008 (17)
April, 2008 (17)
March, 2008 (26)
February, 2008 (21)
January, 2008 (28)
December, 2007 (19)
November, 2007 (17)
October, 2007 (31)
September, 2007 (39)
August, 2007 (37)
July, 2007 (43)
June, 2007 (37)
May, 2007 (32)
April, 2007 (38)
March, 2007 (29)
February, 2007 (46)
January, 2007 (31)
December, 2006 (27)
November, 2006 (31)
October, 2006 (32)
September, 2006 (39)
August, 2006 (34)
July, 2006 (40)
June, 2006 (18)
May, 2006 (31)
April, 2006 (34)
March, 2006 (30)
February, 2006 (38)
January, 2006 (44)
December, 2005 (19)
November, 2005 (34)
October, 2005 (24)
September, 2005 (37)
August, 2005 (20)
July, 2005 (24)
June, 2005 (33)
May, 2005 (16)
April, 2005 (22)
March, 2005 (34)
February, 2005 (15)
January, 2005 (37)
December, 2004 (28)
November, 2004 (30)
October, 2004 (34)
September, 2004 (22)
August, 2004 (34)
July, 2004 (18)
June, 2004 (64)
May, 2004 (49)
April, 2004 (21)
March, 2004 (29)
February, 2004 (29)
January, 2004 (36)
December, 2003 (25)
November, 2003 (24)
October, 2003 (59)
September, 2003 (42)
August, 2003 (24)
July, 2003 (44)
June, 2003 (29)
May, 2003 (21)
April, 2003 (30)
March, 2003 (27)
February, 2003 (47)
January, 2003 (50)
December, 2002 (31)
November, 2002 (38)
October, 2002 (44)
September, 2002 (15)
May, 2002 (2)
April, 2002 (4)

Google Ads