r/SQLServer • u/erinstellato Microsoft Employee • Sep 27 '25
Community Request SSMS Friday Feedback: Using PowerShell in SQL Agent jobs
A bit late on a Friday, but another feedback request for SSMS for those who are interested. I have questions about PowerShell, and full disclaimer: I am not a PoSh guru. I do know it's value and widespread use.
I'm interested in how you call PowerShell in SQL Agent jobs, and what module you use.
The options that we see most often are:
- Create a job step as type PowerShell, use the SQLPS module
- Create a job step as type PowerShell, use the SqlServer module
- Create a job step as type CmdExec, use either the SQLPS or SqlServer module
I'm interested in both what module you're using and how you're calling it.
Also, since it came up elsewhere, the PowerShell type job step is not deprecated. But the SQLPS module is replaced by the SqlServer module (and you should be using the SqlServer module). If you're using dbatools.io at all, that's cool to hear about too...and is safe to assume that PowerShell 7.x is preferred?
Appreciate the insight folks!
View all comments
Show parent comment
2
u/alinroc 4 Sep 27 '25
IIRC, there has been some progress made on this in the past 6ish months, the key one being the move to Azure Trusted Signing. If /u/thebeersgoodnbelgium is still around she may be able to shed some light on this (or tell me I'm completely wrong). If you haven't tested dbatools recently, try a new version.