Taking the SPE approach, you could scan by MIME type / Template Name and Extension. It shouldnt take too long to recurse the full media library pulling out the files you wanted.
You could either copy to a single directory or add something to download and scan on the fly.
$sourcePath = Get-Item "/sitecore/media library/Files";
$templateNameToExclude = "Media folder";
function Find-MediaItems {
$items = Get-ChildItem -Path $sourcePath.Paths.FullPath -Recurse |
Where-Object {($_.TemplateName -eq "File") -and ($_.Extension -eq "js") -and ($_."Mime Type" -eq "application/x-javascript") }
foreach($item in $items) {
$item;
// Add in scanning actions here
}
}
$props = @{
InfoTitle = "Javascript files"
InfoDescription = "Files to be scanned"
PageSize = 25
}
Find-MediaItems |
Show-ListView @props -Property @{Label="Name"; Expression={$_.DisplayName} },
@{Label="Updated"; Expression={$_.__Updated} },
@{Label="Updated by"; Expression={$_."__Updated by"} },
@{Label="Created"; Expression={$_.__Created} },
@{Label="Created by"; Expression={$_."__Created by"} },
@{Label="Path"; Expression={$_.ItemPath} }
Close-Window
<setting name="Caching.DisableCacheSizeLimits" value="true"/>
may help improve performance.