ForEach is a term used to use iterate or loop over the given list, array or collection of the objects, strings, numbers etc. Forach is very popular loop mechanism where we can use different cases like loop through files, Numbers, Strings, Processes etc. Powershell version 4.0 brings some performance improvements to the ForEach loop. Syntax Foreach statement has the following syntax where we use ITEM, COLLECTION and CODE-BLOCK.
ForEach(ITEM in COLLECTION)