SimonS SimonS - 3 months ago 21
PowerShell Question

Sync-WDSite Web Application Physical Path Parameter

I've written a script which syncs sites between IIS Servers. All my website got synced without an error, but one site (which is of course the site which matters the most) gets a strange error.

the following code-part synchronizes the sites:

$spp = $path.Get_Item($Name)
$publishsettings = Get-WDPublishSettings -FileName $_.FullName
$sync = Sync-WDSite $Name $Name -sitephysicalpath $spp `
-SourcePublishSettings $publishsettings `
-IncludeApppool `
-WarningAction Continue `
-sourcesettings $settings `
-ErrorAction Continue `
-destinationsettings $settings `
-debug


the error I get is the following (the error is in german, but I tried to translate it into english):

Sync-WDSite : The parameter 'Web Application Physical Path Parameter' was already defined.
In C:\Users\Administrator\desktop\wdeploy.ps1:236 Zeichen:17
+ $sync = Sync-WDSite $Name $Name -sitephysicalpath $spp `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Sync-WDSite], DeploymentException
+ FullyQualifiedErrorId : Microsoft.Web.Deployment.PowerShell.SyncSite


I have absolutely no idea where this comes from.

Note that I used the
-debug
Parameter to see each step the cmdlet does. the error occurs at the stage where the other sites gathered information about the site (which site is it, which apppool does it use etc.)

Thanks!

Edit:

Additional Info:
The Publish Settings File for each site has the exact same structure and looks like this:

<?xml version="1.0" encoding="utf-8"?>
<publishData>
<publishProfile
publishUrl="https://server:port/msdeploy.axd"
msdeploySite="Sitename"
destinationAppUrl="http://anysiteurl.domain.com:port/"
mySQLDBConnectionString=""
SQLServerDBConnectionString=""
profileName="Default Settings"
publishMethod="MSDeploy"
userName="server\wdeployadmin"
userPWD="***"
msdeployAllowUntrustedCertificate="True"
agentType="wmsvc"
useNTLM="False"/>
</publishData>


Edit:

Full Error Message as requested by Martin:

writeErrorStream : True
PSMessageDetails :
Exception : Microsoft.Web.Deployment.DeploymentException: Der Parameter 'Web Application Physical Path
Parameter' wurde bereits definiert.
bei Microsoft.Web.Deployment.DeploymentSyncParameterCollection.Add(DeploymentSyncParameter
parameter)
bei Microsoft.Web.Deployment.PowerShell.WDeployCmdletBase.ProcessUserCmd()
TargetObject :
CategoryInfo : InvalidOperation: (:) [Sync-WDSite], DeploymentException
FullyQualifiedErrorId : Microsoft.Web.Deployment.PowerShell.SyncSite
ErrorDetails : Der Parameter 'Web Application Physical Path Parameter' wurde bereits definiert.

InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : bei <ScriptBlock>, C:\Users\Administrator\desktop\wdeploy.ps1: Zeile 245
bei <ScriptBlock>, C:\Users\Administrator\desktop\wdeploy.ps1: Zeile 232
bei <ScriptBlock>, <Keine Datei>: Zeile 1
PipelineIterationInfo : {0, 1}

Answer

You might use msdeploy.exe -verb:sync instead of the Sync-WDSite as a workaround.

Comments