Skip to content

Instantly share code, notes, and snippets.

@noahpeltier
Created June 28, 2021 15:48
Show Gist options
  • Save noahpeltier/163f6139335b99b0f0586d1452f8db41 to your computer and use it in GitHub Desktop.
Save noahpeltier/163f6139335b99b0f0586d1452f8db41 to your computer and use it in GitHub Desktop.
Organize files into folders by file type
(Get-ChildItem -file) | foreach {
if (!$(Test-Path $_.Extension)) {
mkdir "$($_.Extension)"
}
move-item $_.Name -Destination "$($_.Extension)" -Verbose
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment