• bwperrin (8/28/2012)


    Finally figured out how to get it working. SQL uses the sqlps utility, which is a Windows PowerShell mini-shell, and it has some restrictions such as mentioned above. The SQL Agent solution is to use a job step type of not PowerShell, but Operating system (CmdExec). In the code window do: powershell.exe -command "your powershell script"

    What are you referring too specifically?

    You are right that the PowerShell step type runs code in a sqlps mini-shell, however Copy-Item is not restricted in the mini-shell. I just tested it again to be sure. I am happy you got it working via the command-line call but you did not need to do that. Something else was wrong in your previous attempts. Does a sysadmin own your job? Are you using a proxy?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato