While reviewing the code [AutoSPInstallerMain.ps1, line 250] using NotePad++, the editor's syntax parser seems to have an issue with the "back quote / semi-colon" delimiter in the following statement:
Start-Process -FilePath "$PSHOME\powershell.exe" -Verb Runas -ArgumentList "-Command `". $env:dp0\AutoSPInstallerFunctions.ps1`; InstallSMTP (Get-Content $inputFile); Start-Sleep 5" -Wait
Adding another quote after the back quote characters makes NotePad++ happy:
...AutoSPInstallerFunctions.ps1`"; InstallSMTP...
But, I am unsure if adding that quote maintains the integrity of what the command was intended to do.
Comments: ** Comment from web user: mcnga1 **
Start-Process -FilePath "$PSHOME\powershell.exe" -Verb Runas -ArgumentList "-Command `". $env:dp0\AutoSPInstallerFunctions.ps1`; InstallSMTP (Get-Content $inputFile); Start-Sleep 5" -Wait
Adding another quote after the back quote characters makes NotePad++ happy:
...AutoSPInstallerFunctions.ps1`"; InstallSMTP...
But, I am unsure if adding that quote maintains the integrity of what the command was intended to do.
Comments: ** Comment from web user: mcnga1 **
I agree that it does appear that the Notepad++ parser is a bit more "sensitive" than PowerGUI.
If I extract the line in question and simply do a "Write-Host"...
Write-Host Start-Process -FilePath "$PSHOME\powershell.exe" -Verb Runas -ArgumentList "-Command `". $env:dp0\AutoSPInstallerFunctions.ps1`; InstallSMTP (Get-Content $inputFile); Start-Sleep 5" -Wait
I get:
Start-Process -FilePath C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Runas -ArgumentList -Command ". \AutoSPInstallerFunctions.ps1; InstallSMTP (Get-Content ); Start-Sleep 5 -Wait
Which appears to have a missing closing quote character for the "-Command" parameter.
I agree that the command does seem to execute correctly without the closing quote.