To get it to run properly I had to comment out lines 9, 13, 39 and 40. /* and */ are not valid in powershell. Lines 39 and 40 probably should have been outside the code tags.
Also the variable $TypeFolder is never set to a value. What was your intentions for it?
MCP, MCTS, MCITP DBA
Winona State University
"Quality, like Success, is a Journey, not a Destination" - William Soranno '92