HTML   发布时间:2022-04-14  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了powershell – Sync-WDSite Web应用程序物理路径参数大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我编写了一个脚本,用于在IIS服务器之间同步站点.我的所有网站都没有错误同步,但一个网站(当然是最重要的网站)得到一个奇怪的错误.

以下代码部分同步站点:

$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

我得到的错误是以下(错误是德语,但我试图将其翻译成英语):

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

我完全不知道它来自哪里.

请注意,我使用-debug参数来查看cmdlet执行的每个步骤.错误发生在其他站点收集有关站点的信息的阶段(哪个站点是它,它使用哪个apppool等)

谢谢!

编辑:

附加信息:
每个站点的发布设置文件具有完全相同的结构,如下所示:

<?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>

编辑:

@H_966_2@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}

解决方法

您可以使用msdeploy.exe -verb:sync而不是Sync-WDSite作为解决方法.

大佬总结

以上是大佬教程为你收集整理的powershell – Sync-WDSite Web应用程序物理路径参数全部内容,希望文章能够帮你解决powershell – Sync-WDSite Web应用程序物理路径参数所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。