Skip to content

Commit 0c39235

Browse files
authored
Update sql-server-powershell.md
Missed telling the reader the actual piece of code to use (#NOSQLPS).
1 parent a0ebbcb commit 0c39235

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
@@ -63,7 +63,7 @@ Query expressions are strings that use syntax similar to XPath to specify a set
6363

6464
## SQL Server Agent
6565

66-
There's no change to the module used by SQL Server Agent. As such, SQL Server Agent jobs, which have PowerShell type job steps 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 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.
66+
There's no change to the module used by SQL Server Agent. As such, SQL Server Agent jobs, which have PowerShell type job steps 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 `#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.
6767

6868
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.
6969

0 commit comments

Comments
 (0)