Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.