Azure-devops-docs: Delete all directories in the root folder, except test1 and test2

Created on 17 Apr 2020  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

I would like to delete all directories in the root folder, except for 2 (test1 and test2). I have tried several, but I cannot figure out what the syntax should be. Please help! Thankx, Harry

/!({test1,teset2})
/!({test1,test2})
*
/!({test1,test2})


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 devops-cicd-tasktech devopprod stale-issue

Most helpful comment

Documentation is wrong, syntax is:
!(test1|test2)

All 8 comments

@iwhp Have you tried: **/*!({test1,test2}) (although no guarantee....)

Let me find out f this is possible and if so what is the syntax, and we'll get an example added.

Thankx Steve!
Yes I have tried **/*!({test1,test2}), same issue, all files and directories are delete.

Documentation is wrong, syntax is:
!(test1|test2)

Perfect! Thankx a lot! Harry

thanks a lot @Hyperdingo ! :) why is this issue closed? the documentation is still wrong @vtbassmatt

Thanks @dominik-weber - the original issue filer closed it. @steved0x can you fix this one?

@steved0x Please add more examples for matching folders. I too spent a lot of time into figuring out the regex.

This issue hasn't been updated in more than 180 days, so we've closed it. If you feel the issue is still relevant and needs fixed, please reopen it and we'll take another look. We appreciate your feedback and apologize for any inconvenience.

Was this page helpful?
0 / 5 - 0 ratings