0

I have a powershell script that I developed and can run fine manually. However when I put the script into a sql server job and attempt to run the following line...

SET-LOCATION "$NewTargetPath\"
TortoiseProc /command:update /path:$SVNRepository /closeonend:3

I get the following error:

Executed as user: myserviceaccount. A job step received an error at line 146 in a PowerShell script. The corresponding line is 'TortoiseProc /command:update /path:$SVNRepository /closeonend:3'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'The term 'TortoiseProc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.  '.  Process Exit Code -1.  The step failed.

I've checked the paths they all look good and I can even run the command from a powershell command line on the server. Any ideas on where to look for why this error may be occurring?

Lumpy
  • 115
  • 7
  • 1
    Apparently the SQL server job doesn't have access to the path variable. So try to use the full path to `TortoiseProc`. –  Oct 02 '17 at 20:20
  • @Swonkie - That was the answer. thank you. – Lumpy Oct 03 '17 at 12:15

0 Answers0