Skip to content

Instantly share code, notes, and snippets.

@retorillo
Created February 25, 2023 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retorillo/3c9393d6090006166f9505e1ed6278f4 to your computer and use it in GitHub Desktop.
Save retorillo/3c9393d6090006166f9505e1ed6278f4 to your computer and use it in GitHub Desktop.
$shell = new-object -comobject shell.application
$folder = $shell.namespace($pwd.path)
dir | foreach {
$file = $folder.parseName($_.name)
$size = $folder.getDetailsOf($file, 31)
if ($size -eq "") { continue }
if (-not(test-path $size)) { mkdir $size }
move $_.name $size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment