Web-Deploy中的SkipFolderList参数不仅仅跳过该文件夹

问题描述 投票:0回答:1

我们使用WebDeploy来部署我们的.Net项目。当我们想要部署包时,有一个文件夹,我们不想覆盖这些文件。我在WebDeploy Powershell Cmdlets documentation中读到SkipFolderList参数就是这样:它指定不应该覆盖哪些文件夹。但是,当我们执行以下cmdlet时,将跳过所有内容,而不仅仅是指定的文件夹。

$folderList = @('\\Scripts\Custom\Resources')
Restore-WDPackage $WebApp.Path -skipFolderList $folderList -parameters @{"IIS Web Application Name" = $WebsiteName+"\"+$WebApp.Name}

我们使用的论证是错的吗?地址应该以不同的方式指定吗?

powershell iis webdeploy
1个回答
1
投票

我发现你使用了错误的powershell文件夹参数“\ Scripts \ Custom \ Resources”,如果使用此参数,它将显示“正则表达式'\ Scripts \ Custom \ Resources'无效。”错误。

我想这就是为什么你发现你的depoy命令没用的原因。

我建议你可以尝试使用下面的命令,然后它会运行良好。

$folderList = @('\\Scripts\\Custom\\Resources')

结果:

enter image description here

IIS文件夹:它不添加任何内容。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.