I have updated the Dynamics AX 2009 build scripts on CodePlex.
This update features a fix for the clean layer list, there was a powershell variable issue (the variable was declared as string, so couldn't be re-used as an array).
There's also an additional "feature" that contains a tweakable time-out for the calls to AX32, to avoid issues where the build process gets stuck due to a client dialog (can't connect to AOS etc).
A third addition/fix is to remove the read-only flag from the label file after copying it to the application folder.
I've associated a new release with all the scripts in one zip file.