Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

simple powershell help

$
0
0
Hi,


I need to change multiple .txt file names in a folder.

I have found information about renaming the files using Powershell but I do not what to rename the file. I want to add an "_Deviation" to it.

I go into powershell and can get this far.

PS C:\Users\Brandon> cd "C:\Users|Brandon|Desktop|Deviation"
PS C:\Users|Brandon|Desktop|Deviation> Dir | Rename-Item -NewName { $_.name -replace" ",:_" }

What is in bold does not help me though. that is just how you can add a _ to where a space was.
I think I need a something other than the "Rename" command or whatever you call it.

I just need to know how to change the part that is in bold so that it will just add a "_Deviation" to the end of the file name

so it looks like this:

RA-0001_Deviation

instead of RA-0001

thanks for any help.

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>