Reputation: 675
What am I doing wrong?
As a step in a Job I am trying to overwrite file by copying the drive is mapped, but I am using unc path just in case.
In PowerShell this works in the command line interface.
Copy \V240\folder\foo.txt \V240\folder\bar.txt
When I put it in a Job Agent in SQL Server with the PowerShell option it says successfully completed but the file has not been copied.
Upvotes: 1
Views: 2361
Reputation: 41767
The Powershell SQL Agent job step starts Powershell sqlps host in the SQL Server provider. I would try setting location (cd) to the filesystem provider before copying
set-location c:\
Copy \V240\folder\foo.txt \V240\folder\bar.txt
Upvotes: 1