specify Drive location when creating web apps

Aug 23, 2012 at 1:59 PM

Hello,
I am trying to create a variable to add a path to the web application configuration sections so I can point to a folder on a different drive and not on c:\inetpub. Detatils as follows

Error:

Exception             : System.Management.Automation.ParameterBindingException:Cannot bind parameter because parameter 'Path' is specified more than once.

CategoryInfo      alidArgument: (:) [New-SPWebApplication],ParameterBindingException

FullyQualifiedErrorId : ParameterAlreadyBound,Microsoft.SharePoint.PowerShell.S                       PCmdletNewSPWebApplication

ErrorDetails         :InvocationInfo       : System.Management.Automation.InvocationInfo

PipelineIterationInfo : {}

PSMessageDetails     :

 

xml web app section

<WebApplication type="Portal"
                        name="Fou Test Home"
                        applicationPool="Main_AppPool"
                        applicationPoolAccount="USD\svc_SP10_SP_AppPool"
                        url="http://localhost"
                        port="80"
      webpath="e:\apps\"
                        AddURLToLocalIntranetZone="true"
                        databaseName="Home_Content"
                        useClaims="false"
                        useBasicAuthentication="false"
                        useOnlineWebPartCatalog="false">

functions.psi updates

Added

$webpath = $WebApp.webpath
 EnsureFolder $webpath

changed to add -Path  (in both lines)

      New-SPWebApplication -Name $WebAppName -ApplicationPoolAccount $account -ApplicationPool $AppPool -Path $webpath -DatabaseServer

$DBServer -DatabaseName $database -HostHeader $HostHeader -Url $url -Port $port -SecureSocketsLayer:$UseSSL -AuthenticationProvider $AuthProvider @pathSwitch |

Out-Null

If anyone else has a fix?

Thanks
Dan

 

Aug 23, 2012 at 2:21 PM

NeverMind I have fixed the issue, I had to remove the @pathSwitch from the New-SPWebApplication lines.