May 22, 2007
@ 05:57 AM

Jeffery Snover, an Architect on the PowerShell team, has a really good post here.

One thing I find, using PowerShell, is that it's natural to want to have one place to do everything, but the world really works better when you have specialization. PowerShell works really well for me as an integration tool. I often want to do things like threading, create new types, implement interfaces, etc., in PowerShell, but I'm kind of glad I can't.

In general, If I'm going to be writing new code, not integrating existing code, I think PowerShell is the wrong tool for the job. I would rather not have the language and the shell itself encumbered by the fact that people are using it to do things that should really be done in a systems programming language. Think about it: In C#/Visual Studio...I have intellisense, help, unit testing features, syntac highlighting (Code Rush!). That's where I want to write lots of code.

PowerShell is right in the sweet spot for automation and integration. I can go without Visual Studio (though it would be nice!) and TDD, because I'm not writing massive amounts of code in PowerShell. This is my virtuous cycle.

An old boss of mine, Josh McKone used to say, "Make it easy to do good things and hard to do bad things," as hid kind of mantra for API/library design. I think PowerShell hits this mark perfectly.


 
Categories: scripting | PowerShell

October 30, 2006
@ 09:35 AM

This weekend, at Code Camp Seattle 2.0, Peter Provost and Brad Wilson presented on Worlds of Warcraft, and how you could use a scripting language, LUA, built into it to change the UI. I don't play WoW, but though it would be an interesting change (it was!)

LUA seemed like an interesting language. I can think opf a number of times over the years, where I had thought that it would be nice to expose scripting extensibility points in my applications. I made a mental note to explore this further.

This morning, while trouble shooting an unrelated problem, I downloaded the latest Wireshark (used to be called Ethereal) and noticed the installer had an option to install LUA (experimental.)

Intersting how seeing something in one place makes you more prone to notice it in others. 


 
Categories: scripting | tool

October 23, 2006
@ 12:57 PM

Today I needed to svn mv a bunch of generated code files. I quickly popped open a Power Shell window and built this up incrementally (in about 2 minutes).

We switched from generating derived classes to generating base classes, then deriving from them (I call this "the sandwich model.") I wanted the history to show the flow from what was our derived classes into what are now base classes.

Anyway, fuzzy mass renaming seems like a major strength of power shell for me lately:

ls *.cs
| where {$_.Name -cnotlike '*WorkItem*' -and $_.Name -cnotlike '*Base*'}
|% {$baseName = [System.IO.Path]::GetFileNameWithoutExtension($_);
$oldName = $baseName + '.cs';
$newName = $baseName + 'Base.cs';
svn mv $oldName $newName;}

 
Categories: scripting | tool

October 17, 2006
@ 08:39 AM

This is dumb, but I find myself using this a lot recently, and want to remember it. Some things I installed a long time ago put some assemblies in the GAC and I kept getting these gac'd references in my assemblies.

gacutil.exe /l 
| where {$_ -like '*nunit*'} 
|% {gacutil /u $_}

I really love the "|%" syntax. I wish C# had that: someCollection |% $_.SomeMethod.


 
Categories: admin | scripting

Last week I saw this useful set of sample scripts for admin tasks. This morning I finally got to review it.

I like this kind of stuff because I rarely have time to learn admin skillz, yet, as a developer, I need to use them for trouble-shooting and keeping our development environment in order.

To bad these weren't in PSH.

Source: STUFF YOU CAN USE!! Finger Saving Good – No Touch Administration
Originally published on Fri, 08 Sep 2006 17:37:00 GMT


 
Categories: tool | admin | scripting