Skip to content

Commit 10f3af5

Browse files
committed
{PowerShell] Created a new NOSQLPS include and updated all SQL Server Agent articles with it
1 parent 8f35846 commit 10f3af5

16 files changed

Lines changed: 153 additions & 141 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Using NOSQLPS for SQL Server Agent with PowerShell
3+
description: Message to explain to use the sqlserver powershell cmdlet instead of the sqlps cmdlet with SQL Server Agent
4+
ms.topic: include
5+
author: markingmyname
6+
ms.author: maghan
7+
ms.reviewer: drskwier
8+
---
9+
10+
Starting with SQL Server 2019, you can disable SQLPS. 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. Now your SQL Agent Job runs the version of PowerShell installed on the machine, and then you can use any other PowerShell module you like.
11+
12+
To use the [**SqlServer module**](https://www.powershellgallery.com/packages/Sqlserver/21.1.18235) in your SQL Agent Job step, you can place this code on the first two lines of your script.
13+
14+
```powershell
15+
#NOSQLPS
16+
Import-Module -Name SqlServer
17+
```

docs/powershell/download-sql-server-ps-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: markingmyname
88
ms.author: maghan
99
ms.reviewer: matteot, drskwier
1010
ms.custom: ""
11-
ms.date: 10/14/2020
11+
ms.date: 10/14/2020
1212
---
1313

1414
# Install the SQL Server PowerShell module

docs/powershell/encode-and-decode-sql-server-identifiers.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: Some characters that can appear in SQL Server-delimited identifiers
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
7-
ms.assetid: bb9fe0d3-e432-42d3-b324-64dc908b544a
87
author: markingmyname
98
ms.author: maghan
109
ms.reviewer: matteot, drskwier

docs/powershell/escape-sql-server-identifiers.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: Some characters that can appear in SQL Server-delimited identifiers
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
7-
ms.assetid: 8a73e945-daa6-4e5d-93da-10f000f1f3a2
87
author: markingmyname
98
ms.author: maghan
109
ms.reviewer: matteot, drskwier

docs/powershell/how-to-enable-tcp-sqlps.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: Learn how to enable TCP protocols using SQLPS
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
7-
ms.assetid: 89b70725-bbe7-4ffe-a27d-2a40005a97e7
87
author: markingmyname
98
ms.author: maghan
109
ms.reviewer: matteot

docs/powershell/load-the-smo-assemblies-in-windows-powershell.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: Learn how to load the SQL Server Management Object (SMO) assemblies
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
7-
ms.assetid: 8ca42b69-da5a-47f4-9085-34e443f0e389
87
author: markingmyname
98
ms.author: maghan
109
ms.reviewer: matteot, drskwier

docs/powershell/manage-authentication-in-database-engine-powershell.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ titleSuffix: SQL Server on Linux
55
ms.prod: sql
66
ms.technology: sql-server-powershell
77
ms.topic: conceptual
8-
ms.assetid: ab9212a6-6628-4f08-a38c-d3156e05ddea
98
author: markingmyname
109
ms.author: maghan
1110
ms.reviewer: matteot, drskwier

docs/powershell/manage-tab-completion-sql-server-powershell.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: Learn how to control Windows PowerShell tab completion by making pr
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
7-
ms.assetid: 6296848a-890f-4ad3-8d9f-92ed6a79aa00
87
author: markingmyname
98
ms.author: maghan
109
ms.reviewer: matteot, drskwier

docs/powershell/navigate-sql-server-powershell-paths.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: Learn how to use PowerShell cmdlets to navigate the path structures
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
7-
ms.assetid: d68aca48-d161-45ed-9f4f-14122ed30218
87
author: markingmyname
98
ms.author: maghan
109
ms.reviewer: matteot, drskwier
@@ -14,7 +13,7 @@ ms.date: 10/14/2020
1413

1514
# Navigate SQL Server PowerShell Paths
1615

17-
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW ](../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
16+
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW](../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
1817

1918
The [!INCLUDE[ssDE](../includes/ssde-md.md)] PowerShell provider exposes the set of objects in an instance of SQL Server in a structure similar to a file path. You can use Windows PowerShell cmdlets to navigate the provider path, and create custom drives to shorten the path you have to type.
2019

docs/powershell/query-expressions-and-uniform-resource-names.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Query Expressions and Uniform Resource Names | Microsoft Docs"
2+
title: Query Expressions and Uniform Resource Names
33
description: Learn about Query Expressions, which enumerate one or more objects in an object model hierarchy, and about Uniform Resource names (URNs), which uniquely identify a single object.
44
ms.prod: sql
55
ms.technology: sql-server-powershell
@@ -8,7 +8,6 @@ helpviewer_keywords:
88
- "query expressions"
99
- "unique resource names"
1010
- "URN"
11-
ms.assetid: e0d30dbe-7daf-47eb-8412-1b96792b6fb9
1211
author: markingmyname
1312
ms.author: maghan
1413
ms.reviewer: matteot, drskwier
@@ -18,7 +17,7 @@ ms.date: 10/14/2020
1817

1918
# Query Expressions and Uniform Resource Names
2019

21-
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW ](../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
20+
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW](../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
2221

2322
The [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] Management Object (SMO) models and [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] PowerShell snap-ins use two types of expression strings that are similar to XPath expressions. Query expressions are strings that specify a set of criteria used to enumerate one or more objects in an object model hierarchy. A Uniform Resource Name (URN) is a specific type of query expression string that uniquely identifies a single object.
2423

0 commit comments

Comments
 (0)