how can i run a powershell file in sql server 2005
Hi Patrick.I,
I met the same issue as you before. And the issue was caused by the PowerShell script doesn't work correctly.
Could you please try to run the PowerShell script manually, and make sure it works correctly?
Thanks,
Jin ChenJin Chen - MSFT
January 22nd, 2011 7:01pm
I have a powershell script i would like to run as a job in my sql server 2005 like below
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Nologo -NoProfile -Command "& 'D:\DeleteEmployeeItems.PS1'"
But keep getting error
D:\DeleteEmployeeItem s.PS1' is not recognized as the name of a cmdlet, function, script file, or ope rable program. Check the spelling of the name, or if a path was included, verif y that the path is correct and try again. At line:1
char:2 + & <<<< 'D:\DeleteEmployeeIte ms.PS1' + CategoryInfo : ObjectNotFound: (D:\PowerShell\S...ployeeItems.P
S1:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException. Process Exit Code 1. The step failed.
Any ideas what 'm doing wrong!!!!!!!!!!!!!
What is the correct command???
Thanks in advance
Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2011 7:26pm
after pulling out my hair tried this:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noexit &''D:\DeleteEmployeeItems.PS1"
But the job just keep running and never ends:)
January 22nd, 2011 7:49pm
Can you please check the
similar thread here
this may help you..
Let us TRY this |
My Blog :: http://quest4gen.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2011 8:11pm