Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

How do I execute a PowerShell Script

$
0
0

I've googled this, and found arguments as to "why would you do that, blah blah blah"

So please don't ask me why; this is just the way I was told to do it until we can get our SQL DB Mail working. Our shellscript is the one sending the e-mails for now. Thank you.

...

Okay, so my trigger needs to execute a PowerShell Script (.PS1) that I wrote. Do I just give it a filepath or something?

EXEC xp_cmdshell 'powershell.exe -file “C:\files\testrun.ps1"' 

Any help is appreciated.


-Nothing to see. Move along.





Viewing all articles
Browse latest Browse all 8428

Trending Articles



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