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 or files can be ignored (.ExcludePaths and .ExcludeFiles) 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:.RemoveDirs - Bool - (Optional)
In addition to deleting files, directories are also deleted by default. This can be disabled in order to leave empty directories untouched.
Example:.RemoveRootDir - Bool - (Optional)
Directories and sub-directories are deleted by default, including the top-level directory. Deletion of the top level directory can be disabled, while leaving deletion of sub-directories active.
NOTE: .RemoveRootDir is ignored when .RemoveDirs is false.
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:.RemoveExcludeFiles - String/ArrayOfStrings - (Optional)
Specific files 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: