Consider adding -Version to all powershell.exe calls

Topics: Feature Requests
Mar 31, 2014 at 5:45 PM
It would be great if AutoSPInstaller would pass the current running version of powershell to all spawned instances. This is especially useful when trying to install SP2010 on Windows 2012.

An easy way to do this would be to simple add the following to all calls to the powershell.exe

-Version $PSVersionTable.PSVersion.ToString()
Coordinator
Mar 31, 2014 at 7:44 PM
Bear with me... I'm trying to understand how this would be useful. Wouldn't powershell.exe just spawn the current version by default? Just did a quick test on servers with versions 2.0, 3.0 and 4.0 installed respectively, and sure enough spawning powershell.exe from each window spawns exactly the same version...?

Brian
Mar 31, 2014 at 7:55 PM
Good question -- if this was added to all of the calls that spawn powershell, then it would be just a matter of passing in the needed value in the batch file (there could be a parameter for it). Then once the main powershell process is spawned, all subsequent versions would use the same version (whatever version that might be)
Apr 1, 2014 at 6:46 PM
Because SharePoint 2010 requires version 2, but when you run PowerShell on WS12, it uses version 3. AutoSPInstaller fails with SP2010 on Windows Server 2012.