Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit d91791f

Browse files
authored
Merge pull request #17472 from markingmyname/powershell
[PowerShell] Reviewing and updating all PowerShell articles due to new release
2 parents 8a0ea8f + 5c2d115 commit d91791f

18 files changed

Lines changed: 419 additions & 400 deletions

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

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: SQL Server PowerShell version includes
3+
description: Explains that the Sqlserver PowerShell module is the current SQL Server PowerShell command set.
4+
author: markingmyname
5+
ms.author: maghan
6+
---
7+
8+
9+
> [!NOTE]
10+
> There are two SQL Server PowerShell modules; [SqlServer](https://docs.microsoft.com/powershell/module/sqlserver) and [SQLPS](https://docs.microsoft.com/powershell/module/sqlps).
11+
>
12+
> The **SqlServer** module is the current PowerShell module to use.
13+
>
14+
> The **SQLPS** module is included with the SQL Server installation (for backward compatibility) but is no longer updated.
15+
>
16+
> The **SqlServer** module contains updated versions of the cmdlets in **SQLPS** and includes new cmdlets to support the latest SQL features.
17+
>
18+
> Install the **SqlServer** module from the [PowerShell Gallery](https://www.powershellgallery.com/packages/SqlServer).
19+
>
20+
> For more information, see [SQL Server PowerShell](../powershell/sql-server-powershell.md).

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Download SQL Server PowerShell Module
3-
description: Learn how to install the SqlServer PowerShell module, which provides cmdlets that support the latest SQL features, and also contains updated versions of the cmdlets in the SQLPS module.
3+
description: Learn how to install the SqlServer PowerShell module, which provides cmdlets that support the latest SQL features, and also contains updated versions of the cmdlets in the SQLPS module.
44
ms.prod: sql
55
ms.technology: sql-server-powershell
66
ms.topic: conceptual
77
author: markingmyname
88
ms.author: maghan
9-
ms.reviewer: matteot, aanelson
9+
ms.reviewer: matteot, drskwier
1010
ms.custom: ""
11-
ms.date: 06/11/2020
11+
ms.date: 10/14/2020
1212
---
1313

1414
# Install the SQL Server PowerShell module
@@ -120,7 +120,7 @@ If you run into problems installing, see the [Install-Module documentation](http
120120
To use a specific version of the module, import it with a specific version number similar to the following command:
121121

122122
```powershell
123-
Import-Module SqlServer -Version 21.1.18080
123+
Import-Module SqlServer -Version 21.1.18218
124124
```
125125

126126
## Pre-release versions of the SqlServer module
@@ -145,7 +145,7 @@ To install a specific pre-release version of the module, install it with a speci
145145
You can try to use the following command:
146146

147147
```powershell
148-
Install-Module SqlServer -RequiredVersion 21.1.18040-preview -AllowPrerelease
148+
Install-Module SqlServer -RequiredVersion 21.1.18218-preview -AllowPrerelease
149149
```
150150

151151
## SQL Server PowerShell on Linux
@@ -158,6 +158,13 @@ Visit [Manage SQL Server on Linux with PowerShell Core](../linux/sql-server-linu
158158

159159
- [SqlServerDsc](https://www.powershellgallery.com/packages/SqlServerDsc/) - Module with DSC resources for deployment and configuration of Microsoft SQL Server.
160160

161+
## Cmdlet reference
162+
163+
- [SqlServer cmdlets](https://docs.microsoft.com/powershell/module/sqlserver)
164+
- [SQLPS cmdlets](https://docs.microsoft.com/powershell/module/sqlps)
165+
161166
## Next steps
162167

163-
[SQL Server PowerShell](sql-server-powershell.md)
168+
- [SQL Server PowerShell](sql-server-powershell.md)
169+
- [SQL Server PowerShell cmdlets](https://docs.microsoft.com/powershell/module/sqlserver)
170+
- [Use PowerShell with Azure Data Studio](../azure-data-studio/extensions/powershell-extension.md)
Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
---
2-
title: "Encode and Decode SQL Server Identifiers | Microsoft Docs"
2+
title: Encode and Decode SQL Server Identifiers
33
description: Some characters that can appear in SQL Server-delimited identifiers are not supported in Windows PowerShell paths. Learn how to include them by representing them with their hexadecimal values.
4-
ms.custom: ""
5-
ms.date: "03/14/2017"
64
ms.prod: sql
7-
ms.reviewer: ""
85
ms.technology: sql-server-powershell
96
ms.topic: conceptual
107
ms.assetid: bb9fe0d3-e432-42d3-b324-64dc908b544a
118
author: markingmyname
129
ms.author: maghan
10+
ms.reviewer: matteot, drskwier
11+
ms.custom: ""
12+
ms.date: 10/14/2020
1313
---
14+
1415
# Encode and Decode SQL Server Identifiers
16+
1517
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW ](../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
1618

17-
SQL Server-delimited identifiers sometimes contain characters not supported in Windows PowerShell paths. These characters can be specified by encoding their hexadecimal values.
18-
19-
> [!NOTE]
20-
> There are two SQL Server PowerShell modules; **SqlServer** and **SQLPS**. The **SQLPS** module is included with the SQL Server installation (for backwards compatibility), but is no longer being updated. The most up-to-date PowerShell module is the **SqlServer** module. The **SqlServer** module contains updated versions of the cmdlets in **SQLPS**, and also includes new cmdlets to support the latest SQL features.
21-
> Previous versions of the **SqlServer** module *were* included with SQL Server Management Studio (SSMS), but only with the 16.x versions of SSMS. To use PowerShell with SSMS 17.0 and later, the **SqlServer** module must be installed from the PowerShell Gallery.
22-
> To install the **SqlServer** module, see [Install SQL Server PowerShell](download-sql-server-ps-module.md).
23-
24-
25-
Characters that are not supported in Windows PowerShell path names can be represented, or encoded, as the "%" character followed by the hexadecimal value for the bit pattern that represents the character, as in "**%**xx". Encoding can always be used to handle characters that are not supported in Windows PowerShell paths.
26-
27-
The **Encode-SqlName** cmdlet takes as input a [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] identifier. It outputs a string with all the characters that are not supported by the Windows PowerShell language encoded with "%xx". The **Decode-SqlName** cmdlet takes as input an encoded [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] identifier and returns the original identifier.
28-
29-
## <a name="LimitationsRestrictions"></a> Limitations and Restrictions
30-
The **Encode-Sqlname** and **Decode-Sqlname** cmdlets only encode or decode the characters that are allowed in SQL Server-delimited identifiers, but are not supported in PowerShell paths. The following are the characters encoded by **Encode-SqlName** and decoded by **Decode-SqlName**:
31-
32-
|||||||||||||
33-
|-|-|-|-|-|-|-|-|-|-|-|-|
19+
SQL Server-delimited identifiers sometimes contain characters not supported in Windows PowerShell paths. These characters can be specified by encoding their hexadecimal values.
20+
21+
[!INCLUDE [sql-server-powershell-version](../includes/sql-server-powershell-version.md)]
22+
23+
Characters that are not supported in Windows PowerShell path names can be represented, or encoded, as the "%" character followed by the hexadecimal value for the bit pattern that represents the character, as in "**%**xx". Encoding can always be used to handle characters that are not supported in Windows PowerShell paths.
24+
25+
The **Encode-SqlName** cmdlet takes as input a [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] identifier. It outputs a string with all the characters that are not supported by the Windows PowerShell language encoded with "%xx". The **Decode-SqlName** cmdlet takes as input an encoded [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] identifier and returns the original identifier.
26+
27+
## Limitations and Restrictions
28+
29+
The **Encode-Sqlname** and **Decode-Sqlname** cmdlets only encode or decode the characters that are allowed in SQL Server-delimited identifiers, but are not supported in PowerShell paths. The following are the characters encoded by **Encode-SqlName** and decoded by **Decode-SqlName**:
30+
31+
|||||||||||||
32+
|-|-|-|-|-|-|-|-|-|-|-|-|
3433
|**Character**|\ |/|:|%|\<|>|*|?|[|]|&#124;|
35-
|**Hexadecimal Encoding**|%5C|%2F|%3A|%25|%3C|%3E|%2A|%3F|%5B|%5D|%7C|
36-
37-
## <a name="EncodeIdent"></a> Encoding an Identifier
38-
**To encode a SQL Server identifier in a PowerShell path**
39-
40-
- Use one of two methods to encode a SQL Server identifier:
41-
42-
- Specify the hexadecimal code for the unsupported character using the syntax %XX, where XX is the hexadecimal code.
43-
44-
- Pass the identifier as a quoted string to the **Encode-Sqlname** cmdlet
45-
46-
### Examples (Encoding)
47-
This example specifies the encoded version of the ":" character (%3A):
48-
49-
```
50-
Set-Location Table%3ATest
51-
```
52-
53-
Alternatively, you can use **Encode-SqlName** to build a name supported by Windows PowerShell:
54-
55-
```
56-
Set-Location (Encode-SqlName "Table:Test")
57-
```
58-
59-
## <a name="DecodeIdent"></a> Decoding an Identifier
60-
**To decode a SQL Server identifier from a PowerShell path**
61-
62-
Use the **Decode-Sqlname** cmdlet to replace the hexadecimal encodings with the characters represented by the encoding.
63-
64-
### Examples (Decoding)
65-
This example returns "Table:Test":
66-
67-
```
68-
Decode-SqlName "Table%3ATest"
69-
```
70-
71-
## See Also
72-
[SQL Server Identifiers in PowerShell](sql-server-identifiers-in-powershell.md)
73-
[SQL Server PowerShell Provider](sql-server-powershell-provider.md)
74-
[SQL Server PowerShell](sql-server-powershell.md)
75-
76-
34+
|**Hexadecimal Encoding**|%5C|%2F|%3A|%25|%3C|%3E|%2A|%3F|%5B|%5D|%7C|
35+
36+
## Encoding an Identifier
37+
38+
### To encode a SQL Server identifier in a PowerShell path
39+
40+
- Use one of two methods to encode a SQL Server identifier:
41+
- Specify the hexadecimal code for the unsupported character using the syntax %XX, where XX is the hexadecimal code.
42+
- Pass the identifier as a quoted string to the **Encode-Sqlname** cmdlet
43+
44+
### Examples (Encoding)
45+
46+
This example specifies the encoded version of the ":" character (%3A):
47+
48+
```powershell
49+
Set-Location Table%3ATest
50+
```
51+
52+
Alternatively, you can use **Encode-SqlName** to build a name supported by Windows PowerShell:
53+
54+
```powershell
55+
Set-Location (Encode-SqlName "Table:Test")
56+
```
57+
58+
## Decoding an Identifier
59+
60+
### To decode a SQL Server identifier from a PowerShell path
61+
62+
Use the **Decode-Sqlname** cmdlet to replace the hexadecimal encodings with the characters represented by the encoding.
63+
64+
### Examples (Decoding)
65+
66+
This example returns "Table:Test":
67+
68+
```powershell
69+
Decode-SqlName "Table%3ATest"
70+
```
71+
72+
## See Also
73+
74+
- [SQL Server Identifiers in PowerShell](sql-server-identifiers-in-powershell.md)
75+
- [SQL Server PowerShell Provider](sql-server-powershell-provider.md)
76+
- [SQL Server PowerShell](sql-server-powershell.md)
Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
---
2-
title: "Escape SQL Server Identifiers | Microsoft Docs"
3-
description: Some characters that can appear in SQL Server-delimited identifiers are not supported in Windows PowerShell paths. Learn how some of these can be escaped with the back-tick character.
4-
ms.custom: ""
5-
ms.date: "03/14/2017"
2+
title: Escape SQL Server Identifiers
3+
description: Some characters that can appear in SQL Server-delimited identifiers aren't supported in Windows PowerShell paths. Learn how some of these can be escaped with the back-tick character.
64
ms.prod: sql
7-
ms.reviewer: ""
85
ms.technology: sql-server-powershell
96
ms.topic: conceptual
107
ms.assetid: 8a73e945-daa6-4e5d-93da-10f000f1f3a2
118
author: markingmyname
129
ms.author: maghan
10+
ms.reviewer: matteot, drskwier
11+
ms.custom: ""
12+
ms.date: 10/14/2020
1313
---
14+
1415
# Escape SQL Server Identifiers
16+
1517
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW ](../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
1618

17-
You can often use the back-tick escape character (`) to escape characters that are allowed in [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] delimited identifiers but not Windows PowerShell path names. Some characters, however, cannot be escaped. For example, you cannot escape the colon character (:) in Windows PowerShell. Identifiers with that character must be encoded. Encoding is more reliable than escaping because encoding works for all characters.
19+
You can often use the back-tick escape character (`) to escape characters that are allowed in [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] delimited identifiers but not Windows PowerShell path names. Some characters, however, cannot be escaped. For example, you can't escape the colon character (:) in Windows PowerShell. Identifiers with that character must be encoded. Encoding is more reliable than escaping because encoding works for all characters.
1820

19-
> [!NOTE]
20-
> There are two SQL Server PowerShell modules; **SqlServer** and **SQLPS**. The **SQLPS** module is included with the SQL Server installation (for backwards compatibility), but is no longer being updated. The most up-to-date PowerShell module is the **SqlServer** module. The **SqlServer** module contains updated versions of the cmdlets in **SQLPS**, and also includes new cmdlets to support the latest SQL features.
21-
> Previous versions of the **SqlServer** module *were* included with SQL Server Management Studio (SSMS), but only with the 16.x versions of SSMS. To use PowerShell with SSMS 17.0 and later, the **SqlServer** module must be installed from the PowerShell Gallery.
22-
> To install the **SqlServer** module, see [Install SQL Server PowerShell](download-sql-server-ps-module.md).
21+
[!INCLUDE [sql-server-powershell-version](../includes/sql-server-powershell-version.md)]
2322

2423
The back-tick character (`) is usually on the key in the upper left of the keyboard, under the ESC key.
25-
26-
## Examples
27-
This is an example of escaping a # character:
28-
29-
```
24+
25+
## Examples
26+
27+
This is an example of escaping a # character:
28+
29+
```powershell
3030
cd SQLSERVER:\SQL\MyComputer\MyInstance\MyDatabase\MySchema\`#MyTempTable
31-
```
32-
33-
This is an example of escaping the parenthesis when specifying (local) as a computer name:
34-
35-
```
31+
```
32+
33+
This is an example of escaping the parenthesis when specifying (local) as a computer name:
34+
35+
```powershell
3636
Set-Location SQLSERVER:\SQL\`(local`)\DEFAULT
37-
```
38-
39-
## See Also
40-
[SQL Server Identifiers in PowerShell](sql-server-identifiers-in-powershell.md)
41-
[SQL Server PowerShell Provider](sql-server-powershell-provider.md)
42-
[SQL Server PowerShell](sql-server-powershell.md)
43-
44-
37+
```
38+
39+
## See Also
40+
41+
- [SQL Server Identifiers in PowerShell](sql-server-identifiers-in-powershell.md)
42+
- [SQL Server PowerShell Provider](sql-server-powershell-provider.md)
43+
- [SQL Server PowerShell](sql-server-powershell.md)

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ ms.date: 08/06/2020
1616

1717
## How to enable the TCP protocol when connected to the console with SQLPS.
1818

19-
> [!Note]
20-
> The **SQLPS** module is included with the SQL Server installation (for backwards compatibility), but is no longer being updated. The most up-to-date PowerShell module is the **[SqlServer](sql-server-powershell.md)** module.
19+
[!INCLUDE [sql-server-powershell-version](../includes/sql-server-powershell-version.md)]
2120

2221
1. Open a command prompt and type:
2322

@@ -88,10 +87,6 @@ ms.date: 08/06/2020
8887
Restart-Service -Name MSSQLSERVER -Force
8988
```
9089

91-
92-
93-
94-
9590
## Next steps
9691

9792
- [Install the SQL Server PowerShell module](download-sql-server-ps-module.md)

0 commit comments

Comments
 (0)