I finally figured this out after days of no luck. First and foremost, do not use any Microsoft betas, incl Windows 8 Developer Edition, PowerShell 3.0 and VS 2011. Once you have PowerShell 2.0 up and running:
1. in the PS/v1.0 folder add a powershell.exe.config file:
Follow this link for the script:http://connect.microsoft.com/PowerShell/feedback/details/525435/net-4-0-assemblies-and-powershell-v2
restart PowerShell 2.0 and it will now support 4.0 framework.
2. Set the execution policy to require only remote scripts to be sign:
Command line: Set-ExecutionPolicy RemoteSigned
3. Import the required Custom t4 scaffolders (so you can use T4 Scaffold):
Command Line: import-module C:\Users\Admin\Documents\"Visual Studio 2010"\Projects\MvcApplication1\packages\T4Scaffolding.1.0.5\tools\T4Scaffolding.NuGetServices.dll
Command Line: import-module C:\Users\Admin\Documents\"Visual Studio 2010"\Projects\MvcApplication1\packages\T4Scaffolding.1.0.5\tools\T4Scaffolding.dll
4. Now invoke your powershell file:
Command Line:C:\Users\Admin\Documents\"Visual Studio 2010"\Projects\MvcApplication1\MvcApplication1\CodeTemplates\Scaffolders\StevceScaffolders.AjaxGrid\StevceScaffolders.AjaxGrid.ps1
(be sure to quote any folder that has spaces, eg. "Visual Studio 2010"
I certainly think it would have been better if MS provided some insight on this in their documentation.