RemoveDir
Deletes the contents of one or more directories.
RemoveDir() can be used to delete the contents of a directory. By default, the sub-directories are recursed and all files are deleted. Recursion can be disabled (.PathsRecurse), individual sub-directories can be ignored (.ExcludePaths) and files to be deleted can be filtered (.PathsPattern).
.RemovePaths - String/ArrayOfStrings - (Required)
One or more paths can be provided, either as a string or an array of strings. Each path will be traversed and files within it deleted (subject to other settings).
Example:.RemovePathsRecurse - Bool - (Optional)
Directories are scanned recursively by default. Recursion can be disabled.
Example:All discovered files will be deleted by default. Deletion can be restricted to certain files or sub-directories by specifying .RemovePatterns wildcards.
Example:.RemoveExcludePaths - String/ArrayOfStrings - (Optional)
Specific sub-directories can be ignored during recursion.
Example:.PreBuildDependencies - String/ArrayOfStrings - (Optional)
One or more nodes which must be built before this node is built.
The .PreBuildDependencies option ensures the specified targets are up-to-date before the RemoveDir() is executed.
Example: