1

With the described configuration, I have a SQL Agent Job that includes a Powershell step. That step throws an error when it gets to the line

$app = start-process -passthru $program $program_args

saying -

"The error information returned by PowerShell is: 'The term 'start-process' 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."

The lines preceding this seem to work ok. I suspect that the Powershell host that is running the script is crippled regarding that function but I am not able to verify this anywhere.

Jeff Sacksteder
  • 927
  • 9
  • 15

1 Answers1

1

That's correct start-process isn't available in the sqlps mini-shell. You can determine by running get-command:

 SQLSERVER:\>get-command start-*

You could try running a cmdexec job step calling powershell.exe.

Chad Miller
  • 1,101
  • 8
  • 11
  • It's disappointing that CMD is still superior in that regard. Everytime I try to use Powershell for anything useful, I find myself reverting to batch files. – Jeff Sacksteder May 25 '12 at 17:20