You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/powershell/download-sql-server-ps-module.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ There are two SQL Server PowerShell modules:
27
27
-**SQLPS**: The SQLPS is the module used by [SQL Agent](sql-server-powershell.md#sql-server-agent) to run agent jobs in agent job steps using the PowerShell subsystem.
28
28
29
29
> [!NOTE]
30
-
> The versions of the **SqlServer** module in the PowerShell Gallery support versioning and require PowerShell version 5.0 or greater.
30
+
> The versions of the **SqlServer** module in the PowerShell Gallery support versioning and require PowerShell version 5.1 or greater.
31
31
32
32
For help topics, go to:
33
33
@@ -48,33 +48,32 @@ For help topics, go to:
48
48
You can use the [PowerShell extension](../azure-data-studio/extensions/powershell-extension.md), which provides rich PowerShell editor support in Azure Data Studio.
49
49
50
50
## Installing or updating the SqlServer module
51
+
To install the SqlServer module from the PowerShell Gallery, start a [PowerShell](/powershell/scripting/overview) session and run `Install-Module SQLServer`.
51
52
52
-
To install the **SqlServer** module from the PowerShell Gallery, start a [PowerShell](/powershell/scripting/overview) session as an administrator. You can also start Azure Data Studio as an administrator and run these commands in a PowerShell session in the integrated terminal.
53
-
54
-
You can also use *Install-Module SQLServer -Scope CurrentUser* to run elevated permissions. This cmdlet is useful for users who aren't administrators in their environment. However, since the scope is limited to the current user, other users on the same machine can't use the module.
53
+
```powershell
54
+
Install-Module -Name SqlServer
55
+
```
55
56
56
-
### Install the SqlServer module
57
+
If running on Windows PowerShell you can use `Install-Module SQLServer -Scope CurrentUser` to install the module for just the current user and avoid needing elevated permissions.
57
58
58
-
Run the following command in your PowerShell session to install the SqlServer module for all users:
59
+
### Install the SqlServer module for all users
60
+
To install the SqlServer module for all users run the command below in an elevated PowerShell session; start a PowerShell session as administrator:
59
61
60
62
```powershell
61
63
Install-Module -Name SqlServer
62
64
```
63
65
64
66
### To view the versions of the SqlServer module installed
65
-
66
67
Execute the following command to see the versions of the SqlServer module that have been installed
67
68
68
69
```powershell
69
70
Get-Module SqlServer -ListAvailable
70
71
```
71
72
72
-
### Install for the current user rather than as an administrator
73
-
74
-
If you aren't able to run the PowerShell session as an administrator, install for the current user using the following command:
73
+
To view the version of the SqlServer module loaded in the current session
75
74
76
75
```powershell
77
-
Install-Module -Name SqlServer -Scope CurrentUser
76
+
(Get-Module SqlServer).Version
78
77
```
79
78
80
79
### To overwrite a previous version of the SqlServer module
When updated versions of the **SqlServer** module are available, you can install the newer version using the following command:
94
93
95
94
```powershell
96
-
Install-Module -Name SqlServer -AllowClobber
95
+
Update-Module -Name SqlServer -AllowClobber
97
96
```
98
97
99
98
You can use the `Update-Module` command to install the newest version of the SQLServer PowerShell module, but that doesn't remove older versions. It installs the newer version side by side to allow you the ability to experiment with the latest version, yet still have older modules installed.
Visit [Manage SQL Server on Linux with PowerShell Core](../linux/sql-server-linux-manage-powershell-core.md) to see how to install SQL Server PowerShell on Linux.
153
+
Visit [Manage SQL Server on Linux with PowerShell](../linux/sql-server-linux-manage-powershell-core.md) to see how to install SQL Server PowerShell on Linux.
155
154
156
155
## Other modules
157
156
158
-
-[Az.Sql](https://www.powershellgallery.com/packages/Az.Sql/) - SQL service cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core.
157
+
-[Az.Sql](https://www.powershellgallery.com/packages/Az.Sql/) - SQL service cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell.
159
158
160
159
-[SqlServerDsc](https://www.powershellgallery.com/packages/SqlServerDsc/) - Module with DSC resources for deployment and configuration of Microsoft SQL Server.
0 commit comments