Blogging From PowerShell – Retrieving Posts With the MetaWeblog API

One of the most difficult aspects of our name change is that we have thousands of pages (spanning hundreds of posts) that use the keyword, “Monad” instead of “PowerShell.”  For users just starting with PowerShell, that means that the content basically does not exist.  If you search for a solution to “PowerShell Hosting,” you find nothing related to Windows PowerShell.

[Tip: If an internet search for PowerShell help comes up fruitless, try it again using Monad as a keyword.  A vast wealth of PowerShell (when it was called Monad) blogging dates back as far back as September, 2004!]

Jim Launches His PowerShell Blog

It’s an interesting world we live in.  As I was checking my Technorati search for “PowerShell,” I noticed the first PowerShell blog imposter!  The person starts off, “I’m a PM on the PowerShell team and i’m largely responsible for the PowerShell language …”

We don’t have any Program Managers that blog.

So I click into the blog, with a wry smile on my face – thinking how much you all will like the story.  Then I realize exactly how much faster the speed of light is than word-of-mouth.

Abhishek Launches His PowerShell Blog

Abhishek Agrawal, another member of the PowerShell team launched his blog today.  Amongst other things, Abhishek blogged the very cool types.mshxml extension to add MSDN help links to the output of Get-Member.

Enjoy!

Score One for Corporate Transparency

Knowledge is power – and power is a limited resource.  At least, that’s what some folks believe as they obsessively guard information from others.

That’s a load of tripe.  It creates a work environment so fundamentally backwards: employees direct their efforts toward breaking into the cliques, cabals, and secret societies just to get their jobs done – leaving no time for more important things (like customers.)

There are plenty of examples of this inside of Microsoft.  Rather than give a bad example of information hoarding, let me instead give a powerful example of transparency – the folks behind the Windows Live Mail team.

The Story Behind the Naming and Location of PowerShell Profiles

“<My Documents>\WindowsPowerShell\Microsoft.PowerShell_profile.ps1.”
and
“<Installation Directory>\Microsoft.PowerShell_profile.ps1.”

It’s probably the 63 characters in PowerShell that have the most thought behind them.  You might ask, “Could it be any longer?  More random?”

Sure!  Other considerations were:

[C:\temp]
PS:55 > $random = new-object Random
[C:\temp]
PS:56 > $output = $null; 1..100 | % { $output += [char]$random.Next(97, 122) }; "$output.ps1"
wvrybyxwmtcftvhnsvbednocjrdkcyysjtwnhbkkfrgtamxxdbeckjjjgopivnumtjuaxsgrlpylhucvtegauwhajnhrlbnqwsyp.ps1

[C:\temp]
PS:57 > $output = $null; 1..100 | % { $output += [char]$random.Next(97, 122) }; "$output.ps1"
rwyjumqtjxbklsorgtrwbuqklnfjbhonulevewfhfnpllvgslvkcacowgowgggrbinpynsminjqneeypglwewlmswhopaxbxuocx.ps1

[C:\temp]
PS:58 > $output = $null; 1..100 | % { $output += [char]$random.Next(97, 122) }; "$output.ps1"
ggfsjbnqlbrbogytjmdvavcfevioirsocbjageuvwvhuomasxgohkfwjeynnryhsidynwynerhxdogpqupqcclevdavgpgexonml.ps1

[C:\temp]
PS:59 > $output = $null; 1..100 | % { $output += [char]$random.Next(97, 122) }; "$output.ps1"
mmuyrkodgttwjwschfqvxckwdgnlcynbtdditrjrvboifywsnbqjwpnkbxulvcahfscfskhpuxawnbqeiuxbieddpsgvvxutahdm.ps1

:)

Monad Evolves to Windows PowerShell

Bob Muglia’s Microsoft Management Summit (MMS) keynote this morning unveiled a series of exciting announcements surrounding Monad – now known as Windows PowerShell:

This marks a significant milestone in the Windows PowerShell product lifecycle, and brings us an important step closer to getting a finished product in your hands.

Using msh.exe interactively from within other programs

In a recent post, Andy describes his quest to use msh.exe as the Emacs interactive shell.  He got single commands to work, but the interactive experience does not output any prompts.  This will be the experience from any application that redirects Monad’s standard input stream.

First, the syntax to make Monad read commands from a redirected input stream is -command –.  This places Monad into batch input mode.  In the batch input mode, Monad treats standard input as though it is content in a script, allowing a scenario like:

Breaking Open the dir-LIVE Script

I mentioned earlier that I was going to dissect the dir-LIVE script – it’s taken a bit longer to get to it than I had planned, but I tried to make even this joke a learning opportunity.

When you open the script, the first thing you’ll notice is that it’s mostly composed of junk characters.  “Wow,” you might say – “how does that turn into a directory listing?”

 It’s really just a slight-of-hand – not a super cool obfuscation technique.

Monad Team Foundation Source Control Provider Now Available

After people learn about Monad providers, one of the most common things I hear is – “I wish there was one for Team Foundation’s Source Control.”

James Manning (from the TFS team) agrees!  He wrote one in November of last year, with hopes to push it out as a PowerToy.  Instead, he did us one better by putting it up on the MSH Community Extensions workspace!

MSH jmanning-test:\> dir -name -r
60406-testing
60406-testing\ConsoleApplication77
60406-testing\ConsoleApplication77\ConsoleApplication77
60406-testing\ConsoleApplication77\ConsoleApplication77.sln
60406-testing\ConsoleApplication77\ConsoleApplication77.vssscc
60406-testing\ConsoleApplication77\ConsoleApplication77\ConsoleApplication77.csproj
60406-testing\ConsoleApplication77\ConsoleApplication77\ConsoleApplication77.csproj.vspscc
60406-testing\ConsoleApplication77\ConsoleApplication77\Program.cs
60406-testing\ConsoleApplication77\ConsoleApplication77\Properties
60406-testing\ConsoleApplication77\ConsoleApplication77\Properties\AssemblyInfo.cs
MSH jmanning-test:\> dir -r | ft -a changesetid,serveritem

ChangesetId ServerItem
----------- ----------
          2 $/60406-testing
          3 $/60406-testing/ConsoleApplication77
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77.sln
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77.vssscc
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77/ConsoleApplication77.csproj
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77/ConsoleApplication77.csproj.vspscc
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77/Program.cs
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77/Properties
          3 $/60406-testing/ConsoleApplication77/ConsoleApplication77/Properties/AssemblyInfo.cs

Enjoy.

HOWTO: Win any contest by being the only one competing

As pointed out by Scott Hanselman, somehow – my get-answer script is being used as cudgel in a
Monad vs Ruby debate.  Ted Neward mentions how cool the script is (with a title bound to
stir Ruby natives.) Glenn Vanderburg, in kind, jumps to Ruby’s defense.

As far as the language goes, Glenn’s main point is that Ruby is much more concise than Monad.

This is where the title of my post comes from – it’s easy to win any contest if you’re the
only one competing in it :)  I write my aricles with a heavy prejudice towards teaching,
illustration, and explanation.  Without that style, the Monad script can be written in a form
that is nearly line-for-line equivalent to the Ruby example: