Delete everything in a directory except for one hidden directory in MSBuild

msbuild

Solution

<Target Name="DeleteMe">
   <ItemGroup>
      <DeleteMe
         Include="$(PathRoot)/FolderToDelete/**/*.*"
         Exclude="$(PathRoot)/FolderToDelete/DoNotDeleteThisHiddenFolder/**/*.*"
         />
   </ItemGroup>
   <Delete Files="@(DeleteMe)" />
</Target>

Problem

What's the best way to delete the entire contents of a directory, except for one (hidden) child directory? Thanks!

Original source