Created
March 9, 2026 13:00
-
-
Save keithoma/882dc8c14ea23ccd3eb8dd29f455625d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-ChildItem -Directory -Recurse | | |
| Sort-Object { $_.FullName.Length } -Descending | | |
| ForEach-Object { | |
| $newName = $_.Name -replace ' ', '_' | |
| if ($newName -ne $_.Name) { | |
| Rename-Item -LiteralPath $_.FullName -NewName $newName -WhatIf | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment