Another way to get Monad -- WinFX

For those of you that haven’t yet downloaded Monad through BetaPlace, you now have another option – Beta1 of the WinFX SDK! This is not an NDA release, unlike BetaPlace. Here’s a direct link to the download page. “The WinFX SDK contains documentation, samples and tools designed to help you develop managed applications and libraries using WinFX, which is the set of next-generation managed APIs provided by Microsoft." If you decide to install only portions of the SDK, Monad is one of the products installed in the “Tools and Build Environment” part of the package.

System Administrator Appreciation Day

Today is System Administrator Appreciation Day. Wikipedia summarizes it as: System Administrator Appreciation Day, also known as Sysadmin Day or SAAD (as in Happy SAAD!), falls on the last Friday in July. It exists solely to show appreciation to sysadmins and people with other similar occupations. […] Typical observances of this holiday are to present gifts to your Sysadmin. These gifts include chocolate, beer, wine, electronic toys, video games, and cake & ice cream.

Command-line shortcut for repetitive operations

There are times when you might want to do the same thing many times at the command line. You normally would use a counted for loop: MSH:19 C:\temp\monad > for($x = 0; $x -lt 5; $x++) { do-something } But here’s a neat little trick to save some typing, if you don’t care which iteration of the loop you’re in: MSH:19 C:\temp\monad > 1..5 | foreach { do-something }

"May I please test Longhorn Beta 1?"

You’ve got to love the enthusiasm surrounding Longhorn. In the words of one of its beta coordinators: “This is the first time in 10+ years involvement with customer beta programs that I’ve received an unsolicited bribe to get on the program– two pounds of inscribed chocolate showed up at my office via Fedex today.” The chocolate was shared far and wide – I’ll bet it satisfied at least 1 or 2 mid-afternoon sugar cravings :)

Regular Expressions in Monad

SteveX has a Monad forum on his site, and one of the first topics posted (by Ayende) was an example script on using regular expressions in Monad. This is helpful example of how well Monad integrates with the .Net framework. You can call out to [System.Text.RegularExpressions.Regex], and port your C# regular expression almost effortlessly. But wait, it only gets better. Regular Expressions are a glorious beast of burden in scripting languages, as you might have noticed if you’ve read much Perl.

Param statement, and new-object

Vivek recently posted a helpful script to get the contents of a web page. As is common with .Net and Monad, there is more than one way to do it. In addition, there are also two Monad facilities we can take advantage of to make the script more readable: new-object, and the param statement. First of all, the easy one. The new-object cmdlet creates a new object. In the current drop, it only creates .

Monad Hosting Part II -- Stop acting like cmd.exe!

Travis recently posted a good comment: … I would *love* to be able to configure Monad’s tab completion behavior! … So would we. Tab completion is just one of the many things that would be great to change about the default Monad console host. Other things that drive us crazy are the lack of standard CUA bindings (ie: Copy, Paste, keyboard-based selection,) and full Unicode support, to name a few.

A History Browsing Prompt

Now that we’ve come up to speed with the new beta, it’s time to continue our journey into customizing the prompt. It’s been almost a month since I promised it, and a lot of you are already doing great things with your custom profile. For reference sake, this is our current prompt function, as defined in profile-custom.msh: function prompt { $currentDirectory = Get-Location "MSH $currentDirectory >" } That prompt looks like:

** WARNING ** MSH may make you _too_ efficient

Warning: New research suggests that using Monad (MSH) may make you too efficient. In a recent study, animals that were provided chronic access to MSH worked harder, and ate less. It’s a fun shell, and a fun language – but please, everything in moderation. [Edit: Monad has now been renamed to Windows PowerShell. This script or discussion may require slight adjustments before it applies directly to newer builds.]

Working with the new Monad beta -- getting settled in

As I mentioned earlier, we posted a new MSH beta to BetaPlace. It’s a lot more polished than the one we posted 9 months ago, so I’ll be working with that version from now on. The articles so far haven’t delved very deeply into code just yet (how fortunate!) so there aren’t many breaking changes we need to comply with. However, there have been few – so let’s go over them.