It doesn't help that the custom actions can only be dll, exe and vbs, or that the post build command interface is a bit lousy - when it works!
I was toying with the idea of running a vbs to call the powershell to install and uninstall a wsp file, but we are dealing with 64bit and vbscript calls to ps files don't play nice with 64bit!
So I did a little hunting around for a solution and found the wonderful PS2EXE on codeplex.
The plan was to convert my ps1 files to exe's and then have my msi project call them as exe's...straightforward you would think....perhaps.
So here's how I progressed :
1. Make sure you put full paths into your ps1 files - you can't use contextual paths as the installer runs in the system32 context.
2. Covert your ps1 files to exe's using the PS2EXE
3. Add your files into your VS setup project
4. Add your exe files created from PS2EXE into the custom actions sections
5. Make sure you mark your custom actions files as false for the installerclass
6. Ensure your target platform is set to 64bit
So when you run your setup.exe the final step of the install will execute your powershell files that have been converted to exe's.
Although this is probably not the best solution for some powershell files, its perfect for solutions (wsp's).
Hope this saves your msi frustrations!