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.

1 Answer 1

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.

1
  • 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. Commented May 25, 2012 at 17:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.