Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / PowerShell / PowerShell: Unable to Resolve Package Source

March 15, 2024

PowerShell: Unable to Resolve Package Source

When you try to install PowerShell modules from the online PSGallery, you may see the following error:

Install-Module SqlServer
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'sqlserver. Try Get-PSRepository to see all available registered module repositories.
NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage

PowerShell Install-Module - Unable to resolve package source

A similar error will appear when installing any PowerShell module using Nuget provider, no matter what it is: Exchange Online Powershell module, AzureAD, VMware PowerCLI, PSWindowsUpdate, SecretManagement, SQLServer, etc. At the same time, you can install any offline PowerShell module manually.

The problem may occur on Windows 10, Windows Server 2016, or previous Windows versions. The reason is that PowerShell tries to use a legacy and insecure TLS 1.0 protocol to connect to the PSGallery repository by default. Since April 2020, the PowerShell Gallery accepts connecting to the NuGet provider using TLS 1.2 only.

If TLS 1.0 and TLS 1.1 are not disabled in Windows, run the command below to use TLS 1.2 in the current PowerShell session:

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

TLS 1.2 is supported in all Windows versions starting from Windows 8 and Windows Server 2012. You can display a list of supported TLS versions in PowerShell:

[enum]::GetNames([Net.SecurityProtocolType])

supported tls version in powershell

In order to enable TLS 1.2 support in Windows 7 SP1/Windows Server 2008 R2, install KB3140245 and the MicrosoftEasyFix51044.msi fix.

If your Windows 7 doesn’t support TLS 1.2, you will see Error 0x800CCC1A — Your server does not support the encryption type you have specified if you trying to connect to any modern email service with Outlook.

Now you can install or update the module from PowerShell Gallery:

psgallery install module with tls 1.2 enabled

Next time you open your PowerShell console, you will have to enable TLS 1.2 protocol again. You can display protocol versions used in PowerShell for connection as follows:

[Net.ServicePointManager]::SecurityProtocol

powershell: show current tls version

To avoid enabling TLS 1.2 each time you open PowerShell, you may change the default TLS version for .NET Framework. To do it, make the following changes to the registry using PowerShell:

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord

If your computer is connected to the Internet through a proxy server, make sure that proxy connection is configured in your PowerShell session:

netsh winhttp show proxy

You can import proxy server settings from Windows:

netsh winhttp import proxy source=ie

A similar error when installing PowerShell modules Unable to download from URI is described in the previous article.

0 comment
1
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows Server 2016
previous post
Using Active Directory User Photo as Account Logon Image on Windows
next post
Disable First User Sign-In Animation in Windows 10 and 11

Related Reading

Fix: Remote Desktop Licensing Mode is not Configured

August 24, 2023

Wi-Fi (Internet) Disconnects After Sleep or Hibernation on...

March 15, 2024

How to Install Remote Server Administration Tools (RSAT)...

March 17, 2024

How to Find the Source of Account Lockouts...

March 12, 2024

Managing Windows Firewall Rules with PowerShell

March 11, 2024

How to Delete Old User Profiles in Windows

March 15, 2024

Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)

March 17, 2024

How to Backup and Restore Websites and IIS...

June 8, 2023

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • Fix: Remote Desktop Licensing Mode is not Configured
  • How to Delete Old User Profiles in Windows
  • How to Install Remote Server Administration Tools (RSAT) on Windows
  • Configuring Port Forwarding in Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top