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

Commit ed558e4

Browse files
committed
added PS commands for the copy and validation of folder existence
1 parent 0bd59b6 commit ed558e4

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ For help topics, go to:
3737
[SQL Server Management Studio (SSMS)](../ssms/download-sql-server-management-studio-ssms.md), doesn't install either PowerShell module. To use PowerShell with SSMS, install the **SqlServer** module from the [PowerShell Gallery](https://www.powershellgallery.com/packages/Sqlserver).
3838

3939
> [!NOTE]
40-
> SQL Server Management Studio (SSMS) 16.x (and earlier versions) included a version the **SqlServer** module.
40+
> SQL Server Management Studio (SSMS) 16.x (and earlier versions) included a the **SQLPS** module.
4141
4242
## Azure Data Studio
4343

@@ -73,13 +73,34 @@ This section walks you through the steps of installing the SqlServer PowerShell
7373
Save-Module -Name SqlServer -Path $env:TEMP
7474
```
7575

76-
1. Browse to the folder location in File Explorer to verify that a `$env:TEMP\SQLServer\<SomeVersion>` subfolder exists.
77-
1. Copy the `$env:TEMP\SQLServer\<SomeVersion>` folder you found in step 2 to the destination offline computer in `C:\Program Files\WindowsPowerShell\Modules` folder (this folder would work for both PS5 and PS7).
78-
1. On the offline computer, open a PowerShell window.
79-
1. Run the following command to install the SqlServer PowerShell module on the offline computer. This command essentially registers the module on the offline computer as the files have already been copied.
76+
1. Browse to the folder location in File Explorer to verify that a `$env:TEMP\SQLServer\<SomeVersion>` folder exists or run this command:
8077

8178
```powershell
82-
Import-Module -Name SqlServer
79+
Get-ChildItem -Path $env:TEMP\SQLServer\
80+
```
81+
82+
1. Copy the `$env:TEMP\SQLServer\<SomeVersion>` folder you found in step 2 to the destination offline computer in `%ProgramFiles%\WindowsPowerShell\Modules\SqlServer` folder (this folder would work for both PS5 and PS7). Be sure to replace `<SomeVersion>` with the value you found in the previous step.
83+
84+
```powershell
85+
Copy-Item -Path $env:TEMP\SQLServer\<SomeVersion> -Destination $env:ProgramFiles\WindowsPowerShell\Modules\SQLServer
86+
```
87+
88+
1. Confirm that the SqlServer PowerShell module is available on the offline computer by running the following PowerShell cmdlet:
89+
90+
```powershell
91+
Get-Module SqlServer -ListAvailable
92+
```
93+
94+
The output may look like this (actual version may be different and must match <SomeVersion> listed previously):
95+
96+
```console
97+
PS C:\Users\user1> Get-Module SqlServer -ListAvailable
98+
99+
Directory: C:\Program Files\WindowsPowerShell\Modules
100+
101+
ModuleType Version Name ExportedCommands
102+
---------- ------- ---- ----------------
103+
Script 22.1.1 SqlServer {Add-RoleMember, Add-SqlAvail...
83104
```
84105

85106
### View the versions of the SqlServer module installed

0 commit comments

Comments
 (0)