我试图跳过除 Templates 目录之外的所有目录,但我无法让它工作。 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
很可能是我的正则表达能力让我失望,所以我欢迎任何帮助。
谢谢 马特
最佳答案
您的路径是正确的,但您的 ^
和 $
应该位于表达式的远端:
-skip:objectName=dirPath,absolutePath=^(?!\\Templates\\).*$
关于msdeploy 并跳过未命名为 x 的目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12368655/