powershell comments edit

I haven’t had a lot of time to look into some of the latest MS tech what with the project I’ve been mired in for a while, and yesterday Hanselman turned me on to Monad, the new Microsoft command shell. (Yeah, I’m a little late for this boat, but it’s still in beta, so I’m not that late.) He was showing me some of the ways he’s thinking about automating tasks around work and I gotta say… even the simplest demo is awesome and makes you think in a different way entirely about the usefulness of the command line. Everything is an object? No more parsing text output? It doesn’t get much better than that.

I decided to try it out this morning when I was talking to Stu and he wanted to figure out the most recently modified file in a directory tree. Monad to the rescue, right? One command line:

get-childitem -Recurse -Exclude CVS | sort-object -Property LastWriteTime -Descending | select-object -First 5 | get-property -Property LastWriteTime,FullName | format-table -Property LastWriteTime,FullName -Autosize

That will:

  • Recurse through the filesystem from the current location down
  • Sort all the files found by last write time
  • Get the first five in that list (the most recent five modified files)
  • Get the last write time and full name properties, and
  • Format the property list into a nice table

It ends up looking like this (click to enlarge):

[Monad in action - sorting most recent modified files (click to
enlarge)

I don’t know about you, but I think that’s hot. One line, loads of functionality. I mean, who needs batch scripting now? I can’t wait to get some time to really delve into this thing.

I went out to get the mail last night and found a used condom wrapper in the middle of my damn lawn. How the hell did that get there? I mean, are there illicit sex acts occurring in my yard that I’m not getting to participate in or something?

Regardless, picking up condom wrappers out of your yard is a humbling experience. You really don’t want to touch it, so you kind of get a stick… and push it around for a while until you realize you can’t pick it up with a single stick, so you cast about for a second stick… then you go into the garage and get a shovel…

It also makes you feel like you’re living in some sort of anarchic post-apocalyptic Blade Runner world. Come on, man - rubber wrapper in the suburban yard? Come on.

I guess I should be thankful it wasn’t like a used hypodermic needle or something. The worst I get is a dog turd in the middle of the sidewalk (that was last week) or a condom wrapper in my yard. Lots of shoveling going on around my place.

Next time I’ll take photos. I’m actually having some digital camera problems right now (the problem is that it fucking chews through batteries like a pack of hyenas through a herd of sick wildebeests) so I’m not taking a load of pictures of, well, anything. I plan on getting a new, more battery-friendly camera (hopefully more portable, too), at which time I’ll probably go apeshit with the photos and start taking pictures of random shit again.

We got the invoice for what the food will cost if we invite the full 125 people that we were going to and have all the hors d’oeuvres and such the way we want. It comes to somewhere between “Seasonal Pricing” and “$CALL,” so we’re looking at possible amendments to things.

We know we want that catering place because I don’t want shitty wedding food. I refuse to show up to my own reception and not want what’s at the buffet. I can do that at anyone else’s wedding (sorry, all you people whose weddings I’ve been to, but it’s true - I can’t do another “army pan of teriyaki chicken”). So some changes have to be made.

First, I think we’ll cut slightly back on the food. If we nix the butler-served hors d’oeuvres (you didn’t all actually want the spinach and artichoke dip on bruschetta or the crab cakes, did you?), that’ll save quite a bit, and there are some minor changes to the menu we might be able to do (selecting a different beef dish, for example) to reduce cost… but the largest way to reduce cost is to reduce head count.

As such, we’re going back over the list of potential invitees. Generally speaking, family is safe… but friends we haven’t seen in a looooong time, really distant relatives, people who haven’t actually met one of us already… probably not going to make the list. I had a lot of work people on the list, but I just can’t afford it, so if I work with you but you’re not a) someone I hang out with weekends; b) a really good friend from before I started Corillian; or c) in the wedding party… I don’t know you’ll be getting an invite. Sorry. It’s nothing personal.

Instead, what we’re toying with is a sort of open house deal where it’s a little less formal, possibly a week after the wedding (when we get back from vacation), and that’s where we’ll invite all the people we couldn’t get before.

Of course, that’s all still being discussed, so this whole point might be moot. We’ll see. Jenn’s going to run some more numbers and see how it all comes out.