Hi All, I am constructing a function that returns data from n to n seconds. Lets Say a reading data from a table in SQL Server from 10 to 10 seconds. I would like to do in a way that this function run as Job asynchronous and this parameter was a switch in it, because then I can stop it by stopping the job. I do not know if this is possible something like get-myfunction -seconds 10 -asjob
function get-myfunction { param ([int] $seconds, [swithc] asjob) invoke-sqlcmd -serverinstance myserver -database Mydb -query "Select * from something" | select codigo,nome #Now I do not know how to do to execute in 10 and 10 seconds, maybe put in a loop ? and how to to this #as job start-sleep $seconds }
thanks !!!
laerte Junior |