Have a Question?
< All Topics

Install SqlServer Module without Internet Access

Step to install SqlServer Module without Internet Access

We had encounter the error message below during the installation NuGet Package Provider on Windows 2016 Server which is having Internet Access

Install-PackageProvider -Name "Nuget" -MinimumVersion "" -Force 

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection. 

Solution 1 – Set PowerShell to use TLS 1.2

Set the PowerShell to use TLS 1.2

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Install-PackageProvider -Name "Nuget" -MinimumVersion "" -Force 

Name                           Version          Source           Summary                                                                                                                       
----                           -------          ------           -------                                                                                                                       
nuget                        https://onege... NuGet provider for the OneGet meta-package manager    

Install SqlServer Module

Install-Module -Name SqlServer

Solution 2- Download NuGet & SqlServer Module Manually

Manually copy the Nuget folder from other computer and paste it to C:\Program Files\PackageManagement\ProviderAssemblies

install SqlServer Module without Internet

Verify the NuGet is installed

PS C:\Users\Administrator> Get-PackageProvider | ? Name -like "NuGet"

Name                     Version          DynamicOptions
----                     -------          --------------
NuGet                  Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag...

Download SqlServer Module and save it to C:\Temp

PS C:\> Install-Package SqlServer -Source C:\Temp\ -Verbose
VERBOSE: Using the provider 'NuGet' for searching packages.
VERBOSE: Total package yield:'1' for the specified package 'SqlServer'.
VERBOSE: Performing the operation "Install Package" on target "Package 'SqlServer' version '21.1.18221' from
VERBOSE: InstallPackageLocal' - name='SqlServer', version='21.1.18221',destination='C:\Program

Name                           Version          Source           Summary
----                           -------          ------           -------
SqlServer                      21.1.18221       C:\Temp\         This module allows SQL Server developers, administr...

Create a new Folder called SqlServer in C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Copy all the content in C:\Program Files\PackageManagement\NuGet\Packages\SqlServer.21.1.18221 to C:\Windows\System32\WindowsPowerShell\v1.0\Modules\SqlServer

install SqlServer Module without Internet

Import SqlServer Module

Install-Module -Name SqlServer

You should be able to use all the cmdlet in SqlServer Module now

Reference Links

  1. An introduction to NuGet

Table of Contents
Scroll to Top