Good evening everyone, hoping someone might be able to tell me where I am missing some logic here. The following script works when there is one item in the csv file. Whenever there is more than one item, it fails with “Rename-Item : Cannot convert ‘System.Object’ to the type ‘System.String’ required by parameter ‘Path’. Specified method is not supported.” The header “PointerToSource” is a CIFS file path that is accessible. Like I mentioned, it works great with a single row in the CSV file, but as soon as there are more than one row besides the header, it fails.
This is my first post, but I’ve been around and certainly appreciate all help I’ve gained from others postings.
$filenames = Import-Csv "H:\docs\111\import_d1.csv" foreach [$file in $filenames] { $filepath = $filenames.pointertosource $fileFirstname = $filenames.import_first_name $fileLastname = $filenames.import_Last_name Rename-Item $filepath -NewName $filefirstname-$filelastname.tif
Respectfully,
Aaron Rouse