Skip to content

Instantly share code, notes, and snippets.

@Sy3Omda
Created May 3, 2025 18:26
Show Gist options
  • Save Sy3Omda/4e6111aea523b1763f45d098ba03d564 to your computer and use it in GitHub Desktop.
Save Sy3Omda/4e6111aea523b1763f45d098ba03d564 to your computer and use it in GitHub Desktop.
Get-ChildItem -Recurse -File | Where-Object { $_.Extension -notin @('.doc','.docx','.pdf','.xls','.xlsx','.ppt','.pptx','.txt','.zip') } | ForEach-Object { $_ } ; Get-ChildItem -Recurse -File -Include *.zip | ForEach-Object { $zip = $_.FullName; Expand-Archive -Path $zip -DestinationPath "temp_$($_.BaseName)" -Force; Get-ChildItem -Path "temp_$($_.BaseName)" -Recurse -File | Where-Object { $_.Extension -notin @('.doc','.docx','.pdf','.xls','.xlsx','.ppt','.pptx','.txt','.zip') } ; Remove-Item "temp_$($_.BaseName)" -Recurse -Force }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment