2

我试图跳过除一个之外的所有目录 - Templates 目录 - 但我无法让它工作。模板目录包含在跳过的目录中,或者,如果我从正则表达式的开头删除 \,我将跳过整个 MyTestWebsite 目录....

"C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy.exe" 
-verb:sync -source:contentPath="MyTestWebsite" 
-dest:contentPath="MyTestWebsite",computerName=Server2 
-skip:objectName=dirPath,absolutePath=\\(?!^Templates\\$).* 
-skip:objectName=filePath,absolutePath=keepalive\.htm -whatif

很可能是我的正则表达技巧让我失望了,所以我欢迎任何帮助。

谢谢马特

4

1 回答 1

3

你在正确的道路上,但你的^and$应该在表达式的远端:

-skip:objectName=dirPath,absolutePath=^(?!\\Templates\\).*$
于 2012-09-25T05:21:45.267 回答