The For Each Directory action will iterate through directories under a root directory. 

For Each Directory


A friendly name for this action (will be displayed in the actions workflow area).


Determines if this action will be run within the relevant stage.

Root Directory

The directory containing the directories to be iterated over

Directory Patterns

A list of directory names or patterns to match. Each name/pattern must be entered on a new line. You can specify an exact directory with it's path or you can use pattern matching.

You can exclude directories by prefixing the directory name or pattern with a dash. e.g -*.ignore. Exclude patterns always take precedence over include patterns.

More information about pattern wild cards can be found on the Ant Pattern Usage page


Exclude empty directories

Tick to exclude empty directories from the list of directories to iterate.

Directory Path Variable

An existing variable for storing the full path of the current directory in the iteration. You can use this variable to access the current directory in a child action. 

Directory Name Variable

An existing variable for storing the name of the current directory in the iteration. You can use this variable to access the current directory name in a child action. 

Order By

Specify the directory property to order the directories by when iterating. Select either Created, Modified, Name or Path. By default, the directories are ordered as matched by Path.

Descending order

Tick to order the directories in descending rather than ascending order. 

Log Iteration Text

Select the text (directory name or directory path) to write to the build log for each iteration.

  • No labels