Skip to content

Instantly share code, notes, and snippets.

@hansgafriedzal
Last active April 4, 2025 09:34
Show Gist options
  • Save hansgafriedzal/28929fe9eed7989d83e4e6001925a736 to your computer and use it in GitHub Desktop.
Save hansgafriedzal/28929fe9eed7989d83e4e6001925a736 to your computer and use it in GitHub Desktop.
# yyyyMMdd_HHmmsszzz | % Replace ':'
dir -File | % {
$d = $_.BaseName.Substring(0,8)
md $d -ea 0
move $_.FullName $d
}
$dir = dir -Directory
$dir | % {
$d = $_.BaseName.Substring(0,6)
md $d -ea 0
move $_.FullName $d
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment