It may be a matter of "-datastore (get-datastore $datastoreName)". It's possible that some cmdlets or parameters don't accept strings where they could and instead require a certain type of object as input. It's my understanding that these will be ironed out by release.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
For now you should try, e.g. -datastore (get-datastore mydatastore).
To clarify Hal's comment, we realize that this is a pain and you should be able to just say -datastore mydatastore, and we hope to fix this for GA, but we're not certain that this will happen for 1.0 GA.