Advance SQL Error - Installing the NuGet package provider
Overview
When the Cloudamize Windows Agent or Agentless Data Collector (ADC) attempts to collect Advanced SQL Data, it may need to install the SqlServer PowerShell module. This process requires the NuGet package provider. If the system cannot reach the required Microsoft repositories, the following error will appear in the MS SQL Data Collection Status column:
Exit code = 1. Output: Installing the NuGet package provider. WARNING: Unable to download from URL 'https://go.microsoft.com/fwlink/?LinkID ~~~ Check your internet connection.
Root Cause
The collector is unable to download the NuGet provider because the connection to Microsoft’s package delivery endpoints is blocked by a firewall, proxy, or lack of internet access on the target machine.
Troubleshooting Steps option 1:
Firewall & Proxy Whitelisting
Ensure the target server (or the ADC machine) has outbound access to the following URLs:
https://go.microsoft.comhttps://onegetcdn.azureedge.net
To verify the second URL specifically: Run the following PowerShell command with the verbose flag to see exactly where the connection is failing:
Install-PackageProvider -Name 'NuGet' -MinimumVersion '2.8.5' -Scope CurrentUser -Verbose
Manual Installation via PowerShell
If the automatic installation fails, you can manually trigger the installation while ensuring the correct security protocols (TLS 1.2) are active.
Scenario A: Direct Internet Connection (No Proxy)
Run this command in an elevated PowerShell window:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Install-PackageProvider -Name 'NuGet' -MinimumVersion '2.8.5' -Scope CurrentUser -Force -ErrorAction Stop;
Scenario B: Behind a Proxy Server
If your environment uses a proxy, you must define it within the session:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
# Set your proxy details below
$proxyUrl = "http://your_proxy.com:8443"
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy($proxyUrl, $true);
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials;
# Install using the proxy flag
Install-PackageProvider -Name 'NuGet' -MinimumVersion '2.8.5' -Proxy $proxyUrl -Scope CurrentUser -Force -ErrorAction Stop;
Troubleshooting Steps Option 2
If standard troubleshooting (TLS settings/Proxy) does not work, you must manually sideload the NuGet provider DLL into the Windows file system.
Manual "Offline" Installation of NuGet Provider
Follow these steps if your security policy blocks the automated SSL handshake or if you receive a "No match found" error when trying to point to a local .exe or .zip file.
Step 1: Download the Provider DLL
On a machine with internet access, download the official Microsoft NuGet provider DLL:
Transfer this
.dllfile to the target server using your approved file transfer method.
Step 2: Create the Required Directory Structure
PowerShell requires the provider to exist in a specific versioned folder hierarchy. You must create this manually:
Open File Explorer as an Administrator.
Navigate to (or create) the following path:
C:\Program Files\PackageManagement\ProviderAssemblies\Inside ProviderAssemblies, create a subfolder named
nuget.Inside nuget, create another subfolder named
2.8.5.208.Final Path:
C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208\
Step 3: Place, Rename, and Unblock the File
Move the downloaded
.dllinto the2.8.5.208folder.Rename the file to exactly:
Microsoft.PackageManagement.NuGetProvider.dllUnblock the File: Right-click the
.dllfile > Properties > Check the Unblock box at the bottom > OK.(Note: If you skip this, Windows security will prevent PowerShell from loading the provider.)
Step 4: Verify the Installation
Open a new PowerShell window as an Administrator and run:
Get-PackageProvider -Name NuGet
If successful, the NuGet provider will be listed with version 2.8.5.208.
Step 5: Install the SQL Server Module (Offline Method)
Now that the NuGet "engine" is installed, you can install the SqlServer module from a local directory if the server remains offline:
Place your downloaded
SqlServer.nupkginto a folder (e.g.,C:\LocalRepo).Register the folder as a trusted source:
CODERegister-PSRepository -Name LocalSource -SourceLocation "C:\LocalRepo" -InstallationPolicy TrustedInstall the module:
CODEInstall-Module -Name "SqlServer" -Repository LocalSource
If the issue persists, please capture a screenshot of the error output and collect the log_backup.txt file from the directory:
For ADC: C:\Program Files (x86)\CloudamizeAgentlessDc\log_backup.txt
For Agent: C:\Program Files (x86)\Cloudamize\log_backup.txt
Please attach both the screenshot and the log file in an email to helpdesk@cloudamize.com for further investigation.