2
votes

I'm trying to skip all directories apart from one - the Templates directory - but I can't get it to work. Either the Templates directory is included in the skipped directories or, if I remove the \ from the start of the regular expression, I skip the whole MyTestWebsite directory....

"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

Most likely it is my regular expression skills letting me down so I'd welcome any help.

Thanks Matt

1

1 Answers

3
votes

You were on the right path, but your ^ and $ should have been at the far ends of the expression:

-skip:objectName=dirPath,absolutePath=^(?!\\Templates\\).*$