Author Posts

November 5, 2013 at 8:29 pm

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

}

November 5, 2013 at 8:44 pm

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)

November 6, 2013 at 11:02 pm

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

}