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

Commit 9ead9cd

Browse files
committed
update for 1664965
1 parent fcf5ae5 commit 9ead9cd

1 file changed

Lines changed: 60 additions & 32 deletions

File tree

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Download SQL Server PowerShell Module | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: 01/31/2019
4+
ms.date: 01/23/2020
55
ms.prod: sql
66
ms.reviewer: ""
77
ms.technology: scripting
@@ -11,62 +11,90 @@ keywords:
1111
ms.assetid:
1212
author: markingmyname
1313
ms.author: maghan
14+
ms.reviewer: carlrab
1415
---
1516
# Install SQL Server PowerShell module
17+
1618
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
1719

1820
This article provides directions for installing the **SqlServer** PowerShell module.
21+
22+
## PowerShell modules for SQL Server
23+
24+
There are two SQL Server PowerShell modules:
25+
26+
- **SqlServer**: The SqlServer module includes new cmdlets to support the latest SQL features. The module also contains updated versions of the cmdlets in **SQLPS**. To download the SqlServer module, go to [SqlServer module in the PowerShell Gallery](https://www.powershellgallery.com/packages/Sqlserver).
27+
- **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.
28+
29+
The versions of the **SqlServer** module in the PowerShell Gallery support versioning and require PowerShell version 5.0 or greater.
30+
31+
For help topics, go to:
32+
33+
- For help topics for the SQL Server PowerShell cmdlets, go to [SqlServer](https://docs.microsoft.com/powershell/module/sqlserver) cmdlets.
34+
- For help topics for the SQLPS cmdlets, go to [SQLPS](https://docs.microsoft.com/powershell/module/sqlps) cmdlets.
35+
36+
## SQL Server Management Studio
37+
38+
SQL Server Management Studio (SSMS), beginning with version 17.0, does not include either PowerShell module. To use PowerShell with SSMS, you must install the **SqlServer** module from the [PowerShell Gallery](https://www.powershellgallery.com/packages/Sqlserver).
39+
1940
> [!NOTE]
20-
> There are two SQL Server PowerShell modules:
21-
> * **SQLPS**: This 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.
22-
> * **SqlServer**: This module includes new cmdlets to support the latest SQL features. The module also contains updated versions of the cmdlets in **SQLPS**.
41+
> “With version 16.x of SSMS, an earlier version of the **SqlServer** module is included with SQL Server Management Studio (SSMS)
42+
43+
## Installing or updating the SqlServer module
2344

24-
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](https://www.powershellgallery.com/packages/Sqlserver).
45+
To install the **SqlServer** module from the PowerShell Gallery, start a [PowerShell](https://docs.microsoft.com/powershell/scripting/powershell-scripting) session as an administrator.
2546

26-
Pre-release versions of the module may become available more frequently: please refer to the section at the bottom of this page on how to get such versions of the module.
47+
> [!IMPORTANT]
48+
> If you run into problems installing, see the [Install-Module documentation](https://www.powershellgallery.com/packages/PowerShellGet/2.2.1) and [Install-Module reference](https://docs.microsoft.com/powershell/module/powershellget/Install-Module).
2749
28-
To install the **SqlServer** module from the PowerShell Gallery, start a [PowerShell](https://docs.microsoft.com/powershell/scripting/powershell-scripting) session and use the following commands. If you run into problems installing, see the [Install-Module documentation](https://www.powershellgallery.com/packages/PowerShellGet/2.2.1) and [Install-Module reference](https://docs.microsoft.com/powershell/module/powershellget/Install-Module).
50+
### To install the SqlServer module
2951

30-
To install the **SqlServer** module:
52+
Run the following command in your administrator session to install the SqlServer module for all users.
3153

3254
```Install-Module -Name SqlServer```
3355

34-
If there are previous versions of the **SqlServer** module on the computer, you may be able to use `Update-Module` (later in this article), or provide the `-AllowClobber` parameter:
56+
### To overwrite a previous version of the SqlServer module
57+
58+
If there are previous versions of the **SqlServer** module on the computer, you may be able to use `Update-Module` (later in this article), or use the `-AllowClobber` parameter:
3559

3660
```Install-Module -Name SqlServer -AllowClobber```
3761

38-
If you are not able to run the PowerShell session as administrator, you can install for the current user:
62+
### Install for the current user rather than as an administrator
63+
64+
If you are not able to run the PowerShell session as administrator, install for the current user using the following command:
3965

4066
```Install-Module -Name SqlServer -Scope CurrentUser```
4167

42-
When updated versions of the **SqlServer** module are available, you can update the version using `Update-Module`:
68+
### Update the installed version of the SqlServer module
69+
70+
When updated versions of the **SqlServer** module are available, update the version using the following command:
4371

4472
```Update-Module -Name SqlServer```
4573

46-
To view the versions of the module installed:
74+
### To view the versions of the SqlServer module installed
75+
76+
Execute the following command to see the versions of the SqlServer module that have been installed:
4777

4878
```Get-Module SqlServer -ListAvailable```
4979

50-
To use a specific version of the module, you can import it with a specific version number similar to the following:
80+
## Using a specific version of the SqlServer module
81+
82+
To use a specific version of the module, import it with a specific version number similar to the following command:
5183

5284
```Import-Module SqlServer -Version 21.1.18080```
5385

54-
> [!NOTE]
55-
> Prerelease (or "preview") versions of the module may be available on the PowerShell Gallery. They may be discovered and installed
56-
> by using the updated *Find-Module* and *Install-Module* cmdlets that are part of the [PowerShellGet](https://www.powershellgallery.com/packages/PowerShellGet)
57-
> module) by passing the *-AllowPrerelease* switch.
58-
>
59-
> To discover the prerelease/preview version of the module, you can run the following command:
60-
>
61-
> ```Find-Module SqlServer -AllowPrerelease```
62-
>
63-
> To install a specific prerelease/preview version of the module, you can install it with a specific version number similar to the following:
64-
>
65-
> ```Install-Module SqlServer -RequiredVersion 21.1.18040-preview -AllowPrerelease```
66-
>
67-
68-
The versions of the **SqlServer** module in the PowerShell Gallery support versioning and require PowerShell version 5.0 or greater.
69-
70-
* [SqlServer module in the PowerShell Gallery](https://www.powershellgallery.com/packages/Sqlserver)
71-
* [SqlServer cmdlets](https://docs.microsoft.com/powershell/module/sqlserver)
72-
* [SQLPS cmdlets](https://docs.microsoft.com/powershell/module/sqlps)
86+
## Using pre-release versions of the SqlServer module
87+
88+
Pre-release (or "preview") versions of the SqlServer module may be available on the PowerShell Gallery. They may be discovered and installed by using the updated *Find-Module* and *Install-Module* cmdlets that are part of the [PowerShellGet](https://www.powershellgallery.com/packages/PowerShellGet) module by passing the *-AllowPrerelease* switch.
89+
90+
### To discover pre-release versions of the SqlServer module
91+
92+
To discover the pre-release (preview) versions of the SqlServer module, run the following command:
93+
94+
```Find-Module SqlServer -AllowPrerelease```
95+
96+
### To install a specific pre-release version of the SqlServer module
97+
98+
To install a specific prerelease/preview version of the module, install it with a specific version number similar to the following:
99+
100+
```Install-Module SqlServer -RequiredVersion 21.1.18040-preview -AllowPrerelease```

0 commit comments

Comments
 (0)