Created
June 13, 2017 18:33
-
-
Save soyfrien/a86b00f0dad22974d118b6951730ca58 to your computer and use it in GitHub Desktop.
rename integer named folders to maestro[n]
This file contains 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
$topcon_controlsPath = "FULL_PATH" | |
$i = 1; | |
$dirs = Get-ChildItem -Directory $topcon_controlsPath | Select-Object -ExpandProperty Name | ForEach-Object { [Int]$_ } | Sort-Object | |
foreach ($d in $dirs) | |
{ | |
$currentPathName = $topcon_controlsPath + "\" + $d | |
$newPathName = $topcon_controlsPath + "\Maestro" + $i | |
#Read-Host -Prompt "Press Enter to rename $currentPathName to $newPathName" | |
#Rename-Item -Path $currentPathName -NewName $newPathName | |
Write-Host "Renamed $currentPathName to $newPathName" | |
$i++ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment