Using PowerShell against MOSS

News to me!! I always thought that you couldn't use powershell to script changes to SharePoint 2007.
Apparently not. With some simple reflection of the 12 hive assemblies you can load the assemblies like this:

[System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”)

[System.Reflection.Assembly]::Load(“Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”)

Then you are free to call the SharePoint object model with PowerShell, however you please.