David at the Holy VM! blog just put up an article with a script showing you how to create port groups using PowerCLI. He was kind enough to reference my book as inspiration, so the least I can do in return is link to it.
Be sure to follow David’s blog, I see several interesting posts on there recently about his experiences with vSphere.

I just finished posting a script that I wrote a couple of weeks ago that will allow you to pre-plan your switching in a CSV file and then execute based on the imported information. I’ve found that it allows me to create “Switching Profiles” if you will and has been extremely helpful in our environment.
I’ve posted the script on my site and I hope you and others find it useful. I’m always open to suggestions or improvements.
http://day2dayadmin.blogspot.com/2009/10/configuring-network-with-powercli-and.html
Thank you for writing the book. I’ve found it to be invaluable as I’ve dedicated the last couple of months to nurture my burgeoning PowerShell abilities.