question

kalpu234 avatar image
kalpu234 asked

SQL Server Agent Job step is moving to next step without running powershell command

I have created SQL Server Agent job and has 2 steps

step 1) Run powershell command Powershell.exe -file 'C:\script\psfile.ps1'

step2) Run t-sql command.

When I scheduled the SQL Server agent job . It is successfully completing without running step1. and Step1 is not even creating any output file which i have defined on the job step 1 .

When I run powershell command or powershell file itself , it is executing successfully on powershell ISE..

Can some advice the solution for this?

job step is running under SQL Server agent service account which has admin right on SQL Server and Windows level.


powershellsql-server-agent
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.