This project has moved. For the latest updates, please go here.

Issue with pre-existing web app with same url, diff display name.


I was running the script after modifying a few things to reprovision search and the web app had a different name by then but the same url. The script will try (and fail) to create the web app with the same url.

This is the fix:

In AutoSPInstallerFunctions.ps1
in Function CreateWebApp
Change line:
$getSPWebApplication = Get-SPWebApplication | Where-Object {$_.DisplayName -eq $webAppName }
To this:
$getSPWebApplication = Get-SPWebApplication | Where-Object {$_.DisplayName -eq $webAppName __-or $_.Url -eq $url__}