I want to iterate over files in a folder using powershell script;
+2
A:
Get-ChildItem | ForEach-Object { <# do what you need to do #> }
or shorter:
gci | % { <# ... #> }
or if you want an explicit looping construct:
foreach ($file in Get-ChildItem) {
# ...
}
Joey
2010-08-31 02:00:14
*sigh* Is there a way of getting useful syntax highlighting on SO? It mangles block comments as well :-(
Joey
2010-08-31 02:03:40