Remove everything in a directory except one hidden directory in MSBuild
What's the best way to delete all contents of a directory except one (hidden) child directory? Thank!
+3
Pete montgomery
source
to share
1 answer
<Target Name="DeleteMe">
<ItemGroup>
<DeleteMe
Include="$(PathRoot)/FolderToDelete/**/*.*"
Exclude="$(PathRoot)/FolderToDelete/DoNotDeleteThisHiddenFolder/**/*.*"
/>
</ItemGroup>
<Delete Files="@(DeleteMe)" />
</Target>
+4
Brian kretzler
source
to share