Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

call powershell with parameter in SQl agent job

$
0
0

I use SQL server agent job to call a powershell script. I am using Type operating system(Cmdexec)

In the job command window, I type:

powershell.exe "D:\PowershellScripts\Write-VolToDb.ps1 'MySQLserver\v2012'  dba"

It is not working. The scipt self is OK, but I just cannot figure out what is the correct syntax to call it.

The 'MySQLserver\v2012'  is my server name\instanceName, dba is the database name. They are two parameter of the powershell.

What is correct syntax of it,

Thanks


SQLFriend


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>