I am trying to execute a power shell script from SQL Server. Every thing works to me with Static value of passed arguments. But when i tried with dynamic argument its not working.
following is the statement which I am trying:
declare @dteBatchDate as varchar(20)
set @dteBatchDate='2014-06-23 15:49:00'
EXEC xp_cmdshell 'powershell.exe -c "get-service | D:\Listing1.ps1 -@dteBatchDate"'
I think it is a syntax issue. Can any body suggest solution regarding this.
Thanks in advanced
