I want to delete all files from $(Build.ArtifactStagingDirectory) (it is so called "a" folder in the appropriate build agent's folder, click here to read more about predefined variables in azure pipelines). I also know that Delete Files task uses the minimatch patterns.
The inner structure of my $(Build.ArtifactStagingDirectory):
a
|--Client
| |--ImportantFolder
| | |--FileNumber1
| | |--....(Many other files here)
| | |--FileNumberN
| |--OtherJunkFolder
| |--OtherFile
|--JunkFolder
So, the folder a has two subfolders (Client and JunkFolder), the Client folder has one folder named ImportantFolder, one folder named OtherJunkFolder and one file named OtherFile. ImportantFolder has the many files with different names and extensions.
How can I delete all folders and files from the folder a except those in folders Client/ImportantFolders? In other words: I want to do something like this:
**
!Client/ImportantFolder/**
But this pattern delete everything from the folder a. I also tried
**
!(Client/**)
and just
**
!(Client)
Both didn't work.

