Home Forums Programming Powershell Cannot use Powershell to UNZIP files inside SQL Job RE: Cannot use Powershell to UNZIP files inside SQL Job

  • We had the same exact problem with something we were working on yesterday (same use case, same copyhere and movehere, same successful completion but nothing actually happening....).

    After searching for an answer (and finding this post as the closest thing, but no answer), and trying a lot of things we solved it by:

    1) In the agent job, create an "Operating system (CmdExec)" step.

    2) In the "Command" put "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\script_location\script_to_call_the_other_script.ps1". (or whatever the path is to powershell and the place where you store your scripts)

    3) This calls a new script that has one line in it with the full path and name of the real script you want to run and any parameters you need to pass.

    I don't know why it needs to wrapped in so many layers, but it works now. Tested and in production and happy customers!!!

    DS