Anyone able to help.
Looking to create a script file that will;
append a file "xxxx" with yyy, so the result will be "xxxxyyy"
Looking to do all files in a given directory.....
Thanks
# "Get-Childitem" - get files and directories.
# "-recurse" - look within each subfolder too, remove if you dont need.
# "C:\Users\username\" - change to the directory you want to use.
# "Where-Object {$_.PSIsContainer -eq $false}" - will exclude directories (folders from the list, otherwise you will rename the folders too).
# "Rename-Item -NewName" - this is the cmdlet that will change the name of the file.
# "$_.Name" This will prepend the original file name.
# "yyyy" - This is what you want to append to the file name, change as you please.
# "$_.Extension" - This will append the file extension onto the file name.
get-childitem -recurse "C:\Users\Username\test" | Where-Object {$_.PSIsContainer -eq $false} | Rename-Item -NewName {$_.Name + "yyyy" + $_.Extension}
Hope that makes sense, BEWARE THIS WILL CHANGE ALL FILE NAMES in the directory you specify and sub directories within.