Compartir a través de


A shell only a geek could love

There’s a bunch of stuff not about testing that I wanted to share or comment on. This is the first of two or three or four non-testing posts on my mind.

 

I recently installed Powershell (formerly known as monad). I played with the betas, but never really used it. The short story is that after using it for a few weeks, now I love the dang thing. I’m a self professed command line junky, and not only does it do everything that my old hopped up command prompt did, but it does about a million other things.

 

Note: Many years ago, I was an avid 4dos user, but for some reason, I never made the transition to 4nt. Now that I think about it, the main reason may have been that I had a licensed copy of 4dos, but was too cheap to pay 75 bucks for 4nt. I missed the ultra customization that these shells allowed, but cmd.exe was fine for most of what I needed to do to be productive.

 

Pictures (or pseudo pictures) are worth hundreds of (if not nearly a thousand) words, so let me just say (and to paraphrase Joel), can your command shell do this?

 

[C:\]

>pushd HKCU:

[HKCU:\]

+>cd \Software\Microsoft\Windows

[HKCU:\Software\Microsoft\Windows]

+>dir

   Hive:

HKEY_CURRENT_USER\Software\Microsoft\Windows

SKC VC Name Property

--- -- ---- --------

 33 0 CurrentVersion {}

  2 1 Shell {BagMRU Size}

  4 2 ShellNoRoam {(default), BagMRU Size}

 

Or

 

[C:\]

>$a = 1,3,5,2,4

[C:\]

>$a

1

3

5

2

4

[C:\]

>$a.GetType()

IsPublic IsSerial Name BaseType

-------- -------- ---- --------

True True Object[] System.Array

[C:\]

>$a | sort

1

2

3

4

5

 

 

or even

 

[C:\]

>$first = "alan"

[C:\]

>$last = "page"

[C:\]

>$fullname = $first + " " + $last

[C:\]

>$fullname

alan page

[C:\]

>$fullname.ToUpper()

ALAN PAGE

[C:\]

 

Not the best examples, but pretty cool nonetheless.

 

Of course, there’s not a ton of practical use on my current team (I don't get to do very much coding or building these days), but I’ve already found dozens of ways to make my life easier with powershell.

 

(I know that there are roughly a gazillion other powershell raves floating arount the intranets, but I couldn't resist adding my own) 

 

The experts know even more.

Comments

  • Anonymous
    August 10, 2006
    but I’ve already found dozens of ways to make my life easier with powershell.

    Please share them so we can all get smarter together.  I'd also be interested in understanding what things you found useful.

    Jeffrey Snover [MSFT]
    Windows PowerShell/Aspen Architect
    Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
    Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
  • Anonymous
    August 10, 2006
    A lot of what I've learned has been from your blog. I don't want to turn this into a powershell blog, but I will commit to a post every other week or so with something cool I use powershell for.