July 1, 2011 at 4:41 am
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 used 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 is not being copied.
July 1, 2011 at 5:32 am
July 1, 2011 at 11:35 am
Copy is a Windows CmdShell command. Try using the Copy-Item PowerShell CmdLet and set the -ErrorAction set to Stop
Copy-Item -Path \\V240\folder\foo.txt -Destination \\V240\folder\bar.txt -ErrorAction Stop
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply