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

Commit 0c8b164

Browse files
author
stevestein
committed
consolidate, delete article, redirect, update toc
1 parent 874a04e commit 0c8b164

4 files changed

Lines changed: 32 additions & 54 deletions

File tree

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,11 @@
32693269
"source_path": "docs/ssms/download-sql-server-ps-module.md",
32703270
"redirect_url": "/sql/powershell/download-sql-server-ps-module",
32713271
"redirect_document_id": false
3272+
},
3273+
{
3274+
"source_path": "docs/powershell/database-engine-powershell-reference.md",
3275+
"redirect_url": "/sql/powershell/sql-server-powershell",
3276+
"redirect_document_id": false
32723277
}
32733278
]
32743279
}

docs/powershell/TOC.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Overview
33
## [SQL Server PowerShell](sql-server-powershell.md)
44
## [SQL PowerShell Modules](https://docs.microsoft.com/powershell/sql-server/overview?toc=/sql/powershell/toc.json)
5-
## [Database engine powershell reference](database-engine-powershell-reference.md)
65
# [Import the SQLPS module](import-the-sqlps-module.md)
76
# [Invoke-PolicyEvaluation cmdlet](invoke-policyevaluation-cmdlet.md)
87
# [Invoke-Sqlcmd cmdlet](invoke-sqlcmd-cmdlet.md)

docs/powershell/database-engine-powershell-reference.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

docs/powershell/sql-server-powershell.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,42 @@ ms.workload: "Active"
2121
---
2222
# SQL Server PowerShell
2323
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
24-
[!INCLUDE[ssCurrent](../includes/sscurrent-md.md)] supports Windows PowerShell, which is a powerful scripting shell that lets administrators and developers automate server administration and application deployment. The Windows PowerShell language supports more complex logic than [!INCLUDE[tsql](../includes/tsql-md.md)] scripts, giving [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] administrators the ability to build robust administration scripts. Windows PowerShell scripts can also be used to administer other [!INCLUDE[msCoName](../includes/msconame-md.md)] server products. This gives administrators a common scripting language across servers.
24+
[!INCLUDE[ssCurrent](../includes/sscurrent-md.md)] supports Windows PowerShell.
25+
26+
> [!NOTE]
27+
> There are two SQL Server PowerShell modules; **SqlServer** and **SQLPS**. The **SQLPS** module is included with the SQL Server installation (for backwards compatability), 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.
28+
> To install the **SqlServer** module, see [Install SQL Server PowerShell](download-sql-server-ps-module.md).
29+
30+
**Why did the module change from SQLPS to SqlServer?**
31+
To ship SQL PowerShell updates, we had to change the identity of the SQL PowerShell module, as well as the wrapper known as `SQLPS.exe`. Because of this change, there are now two SQL PowerShell modules, the **SQLPS** module, and the **SqlServer** module.
32+
33+
**Update your PowerShell scripts if they import the SQLPS module.**
34+
If you have any PowerShell scripts that run `Import-Module -Name SQLPS`, and you want to take advantage of the new provider functionality and new cmdlets, you must change them to `Import-Module -Name SqlServer`. The new module is installed to `%Program Files\WindowsPowerShell\Modules\SqlServer`. Therefore, you do not have to update the $env:PSModulePath variable. If you have scripts that use a third-party or community version of a module named **SqlServer**, use of the Prefix parameter to avoid name collisions. There is no change to the module used by SQL Server Agent.
35+
2536

2637
## SQL Server PowerShell Components
27-
[!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] provides a Windows PowerShell module named **sqlps** that is used to import the [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] components into a Windows PowerShell environment or script. The **sqlps** module loads two Windows PowerShell snap-ins that implement:
38+
The **SqlServer** module loads two Windows PowerShell snap-ins:
2839

2940
- A [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] provider, which enables a simple navigation mechanism similar to file system paths. You can build paths similar to file system paths, where the drive is associated with a [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] management object model, and the nodes are based on the object model classes. You can then use familiar commands such as **cd** and **dir** to navigate the paths similar to the way you navigate folders in a command prompt window. You can use other commands, such as **ren** or **del**, to perform actions on the nodes in the path.
3041

31-
- A set of cmdlets, which are commands used in Windows PowerShell scripts to specify a [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] action. The [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] cmdlets support actions such as running a **sqlcmd** script containing [!INCLUDE[tsql](../includes/tsql-md.md)] or XQuery statements.
42+
- A set of cmdlets that support actions such as running a **sqlcmd** script containing [!INCLUDE[tsql](../includes/tsql-md.md)] or XQuery statements.
3243

33-
To learn about Windows PowerShell, see [Getting Started with Windows PowerShell](https://msdn.microsoft.com/powershell/scripting/getting-started/getting-started-with-windows-powershell).
3444

3545
## SQL Server Versions
3646
The [!INCLUDE[ssCurrent](../includes/sscurrent-md.md)] PowerShell components can be used to manage instances of [!INCLUDE[ssVersion2000](../includes/ssversion2000-md.md)] or later. Instances of [!INCLUDE[ssVersion2005](../includes/ssversion2005-md.md)] must be running SP2 or later. Instances of [!INCLUDE[ssVersion2000](../includes/ssversion2000-md.md)] must be running SP4 or later. When the [!INCLUDE[ssCurrent](../includes/sscurrent-md.md)] PowerShell components are used with earlier versions of [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)], they are limited to the functionality available in those versions.
37-
47+
48+
## SQL Server identifiers that contain characters not supported in PowerShell paths
49+
50+
The **Encode-Sqlname** and **Decode-Sqlname** cmdlets help you specify SQL Server identifiers that contain characters not supported in PowerShell paths. For more information, see [SQL Server Identifiers in PowerShell](sql-server-identifiers-in-powershell.md).
51+
52+
Use the **Convert-UrnToPath** cmdlet to convert a Unique Resource Name for a [!INCLUDE[ssDE](../includes/ssde-md.md)] object to a path for the SQL Server PowerShell provider. For more information, see [Convert URNs to SQL Server Provider Paths](https://docs.microsoft.com/powershell/module/sqlserver/Convert-UrnToPath).
53+
54+
## Query Expressions and Unique Resource Names
55+
56+
Query expressions are strings that use syntax similar to XPath to specify a set of criteria that enumerate one or more objects in an object model hierarchy. A Unique Resource Name (URN) is a specific type of query expression string that uniquely identifies a single object. For more information, see [Query Expressions and Uniform Resource Names](query-expressions-and-uniform-resource-names.md).
57+
58+
59+
3860
## SQL Server PowerShell Tasks
3961

4062
|Task Description|Topic|

0 commit comments

Comments
 (0)