In AutoSPInstallerLaunch.bat in Windows Server 2012 it was incorrectly telling me my PowerShell version was 1 and terminating the script.
Running get-host confirmed powershell was version 3.
The line that was causing the error was line 44:
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" $host.Version.Major | find "1" >nul
When this ran it found a 1 in the instanceID which was part of the string that got returned even though the string reported version 3.0 at the end.
I changed the line to:
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" $host.Version.Major | find "1.0" >nul
and it ran correctly.
I hope this helps correct a small issue before others encounter it.
Jeff Poste
Comments: ** Comment from web user: jmh433 **
Running get-host confirmed powershell was version 3.
The line that was causing the error was line 44:
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" $host.Version.Major | find "1" >nul
When this ran it found a 1 in the instanceID which was part of the string that got returned even though the string reported version 3.0 at the end.
I changed the line to:
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" $host.Version.Major | find "1.0" >nul
and it ran correctly.
I hope this helps correct a small issue before others encounter it.
Jeff Poste
Comments: ** Comment from web user: jmh433 **
Hello Brian,
I have experience the same issue. When the script is checking for PowerShell version it goes directly to V1. I have made changes to the AutoSPInstallerLaunch.bat on the following line.
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" $host.Version.Major | find "3" >nul.
Rather than find "2", use find "3"
Miguel