Powershell script to loop through a txt file to copy files
Hi,
Im trying to copy the files listed in the text file using the below code.
But im ending up with error message.Please suggest how to use the GetFiles() method to loop through a txt file to copy the files.Im a new bie here.Im using powershell to acccomplish this.
Below is my test.txt file
Error :
Winscp 5.5.4 ; windows OS 7 SP1
Please find the attached full script(sample.txt).Im able to come till here in a week research.
You help will be really appreciated.
Im trying to copy the files listed in the text file using the below code.
But im ending up with error message.Please suggest how to use the GetFiles() method to loop through a txt file to copy the files.Im a new bie here.Im using powershell to acccomplish this.
Get-Content C:\test.txt | ForEach-Object{$session.GetFiles("$remotePath/$_", $localPath_out , $False, $transferOptions)}
Below is my test.txt file
shipment_0010000036_140308231803.csv ARV_O_140211144818.csv ARV_V1404212100.csv ARV_V_11111.csv ARV_O_140211144825.csv
Error :
Transfers Failures IsSuccess --------- -------- --------- {/development/cop/data/OUTBOUND/COP_INTER... {WinSCP.SessionRemoteException: 'E:\32616... False
Please find the attached full script(sample.txt).Im able to come till here in a week research.
You help will be really appreciated.