Hello all. What I'm wanting to do is rename a file and then do some things with the new file name.
1. I want to view the new file name with the full path
2. I want to output the new file name with the full path to a text file or csv file
Here is what I have for outputting the renamed file into a text file, but it isn't working:
cls $resultsfile = "C:\results3.txt" clear-content $resultsfile foreach($item in gc C:\RENAME.txt){ Rename-Item $item "1.txt" | out-file $resultsfile -append } notepad $resultsfile
Any thoughts on how to work with the newly renamed file name?