Skip to content

Instantly share code, notes, and snippets.

@runxel
Last active April 26, 2024 08:31
Show Gist options
  • Save runxel/41b30528e43317656b36 to your computer and use it in GitHub Desktop.
Save runxel/41b30528e43317656b36 to your computer and use it in GitHub Desktop.
Powershell script for deleting unwanted apple crap files
# powershell script for deleting unwanted apple crap files – mostly on "infected" USB-sticks
# like ._somecrap
$theSource = "E:\" # <<<<< insert drive here
Get-Childitem $theSource -Include @("._*", ".DS_Store", ".fseventsd", ".TemporaryItems", ".Trashes", ".Spotlight-V100") -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment