I am using below code :
Copy-Item "\\10.X.X.Z\E:\abc\TASKS\AUTO_DAILY_TOLL_NOTICE" -Destination "\\10.X.X.Y\E\AshimTest\myscript" -Recurse
shows up error:
Copy-Item : Cannot find path
'\\10.X.X.Z\E:\CAS\TASKS\AUTO_DAILY_TOLL_NOTICE' because it does not
exist.
At line:1 char:1
+ Copy-Item "\\10.X.X.Y\E:\CAS\TASKS\AUTO_DAILY_TOLL_NOTICE" -Destination
"\\10 ...
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound:
(\\10.0.0.Z\E...ILY_TOLL_NOTICE:String) [Copy-Item],
ItemNotFoundException
+ FullyQualifiedErrorId :
PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
I am missing something here.
Both the servers have credentials, is it because of that ??
I am actually copying from 10.X.X.Z server to 10.X.X.Y server where the powershell script is running.