folder depth level search

  1. Below script is search which level?
  2. Need to search 20 to 30 folder depth level. Want to exclude the 1-19.

workflow media {

Suspend-Workflow

Checkpoint-Workflow

$root=“C:\Windows”
$depth=6
1…($depth+1) | foreach {$root + ("*" * $)} |
Get-ChildItem |
where {$
.Extension -match ‘(.mp3\b|.mp4\b)’
} |

select Directory,FullName,CreationTime,Length |

Export-Csv media.csv

}

That’s a clever way to do it. Looks like all you need to change is the array that’s being piped to ForEach-Object: 20…30 instead of 1…($depth+1)

Its does to stop . Still running in my test VM.


workflow biswajit {

Suspend-Workflow

Checkpoint-Workflow

$root=”C:”

1…10 | foreach {$root + (“*” * $)} |
Get-ChildItem |
where {$
.Extension -match ‘(.mp3\b|.mp4\b|.avi\b|.m4a\b|.m4p\b|.m4v\b|.mobi\b|.mov\b|.mpeg\b|.mpg\b|.vob\b|.wav\b|.wma\b|.wmv\b)’
} |

select Directory,FullName,CreationTime,Length |

Export-Csv D1.csv

}