Remove Zone Identifier
# List files with Zone Identifier
Get-ChildItem -Path "C:\Path\To\Directory" -File -Recurse |
Where-Object { Test-Path "$($_.FullName):Zone.Identifier" }
# Remove Zone Identifiers
Get-ChildItem -Path "C:\Path\To\Directory" -File -Recurse | Unblock-File
Filter Results
Filter by filename
Get-ChildItem -Path "C:\Path\To\Directory" -Recurse -File |
Where-Object { $_.Name -like "vbox-*" } |
Sort-Object FullName |
ForEach-Object { $_.FullName }
Filter by extension
Get-ChildItem -Path "C:\Path\To\Directory" -Recurse -File |
Where-Object { $_.Extension -in ".png", ".jpg" } |
Sort-Object FullName |
ForEach-Object { $_.FullName }
Regex-based filter by extension
Get-ChildItem -Path "C:\Path\To\Directory" -Recurse -File |
Where-Object { $_.Extension -match "^(?i)\.(png|jpg|jpeg|gif)$" } |
Sort-Object FullName |
ForEach-Object { $_.FullName }