Renaming
- the ls object, aka get-child-item will collect all Dir Data
- you can use -rec to recurse
- -filter and -exclude can be used to limit to certain files
- the rni object, aka Rename-Item does the renaming
- the -passthru option shows the results while processing
- the -whatif options only shows what it would do
Replace html enconding
ls | rni -new {$_.name.replace("%20"," ")} -whatif -passthru
Recursive renaming, of only FILES
ls -rec -filter *.md5 -exclude md5sum*.md5 | ? {$_ -is [io.fileinfo]} | rni -new {$_.name.replace(".md5",".iso.md5")} -whatif -passthru
Finding special locations
foreach ($folder in [Enum]::GetValues([System.Environment+SpecialFolder])) {
"{0,-25} = {1}" -f $folder, [Environment]::GetFolderPath($folder)
}