Skip to content

Commit 0480a82

Browse files
committed
tweaks
1 parent d26c6bc commit 0480a82

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/powershell/sql-server-powershell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Query expressions are strings that use syntax similar to XPath to specify a set
5757

5858
## SQL Server Agent
5959

60-
There's no change to the module used by SQL Server Agent. As such, SQL Server Agent jobs which have job steps of the type PowerShell use the SQLPS module. For more information, see [How to run PowerShell with SQL Server Agent](run-windows-powershell-steps-in-sql-server-agent.md). However, starting with SQL Server 2019, you can disable this. To do so, on the first line of a job step of the type PowerShell you can add `#NOSQLPS` which stops the SQL Agent from auto-loading the SQLPS module. When you do this, your SQL Agent Job runs the version of PowerShell installed on the machine, and then you can use any other PowerShell module you like.
60+
There's no change to the module used by SQL Server Agent. As such, SQL Server Agent jobs, which have job steps of the type PowerShell use the SQLPS module. For more information, see [How to run PowerShell with SQL Server Agent](run-windows-powershell-steps-in-sql-server-agent.md). However, starting with SQL Server 2019, you can disable SQLPS. To do so, on the first line of a job step of the type PowerShell you can add, which stops the SQL Agent from autoloading the SQLPS module. When you do this, your SQL Agent Job runs the version of PowerShell installed on the machine, and then you can use any other PowerShell module you like.
6161

6262
If you want to use the **SqlServer** module in your SQL Agent Job step, you can place this code on the first two lines of your script.
6363

0 commit comments

Comments
 (0)