By using this site, you agree to the Privacy Policy.
Accept
EnterinITEnterinITEnterinIT
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Office 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Teams
  • WINDOWS
    • Windows Admin Center
    • Windows Client
    • Windows Server
  • SCCM Query Collection List
Reading: PowerShell unable to resolve package source
Font ResizerAa
EnterinITEnterinIT
Font ResizerAa
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
  • WINDOWS
  • SCCM Query Collection List
Search
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Office 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Teams
  • WINDOWS
    • Windows Admin Center
    • Windows Client
    • Windows Server
  • SCCM Query Collection List
IT Pro

PowerShell unable to resolve package source

Published February 18, 2024
1 Min Read
SHARE

PowerShell is unable to resolve the package source.

When trying to import an excel module in PowerShell an enterprise PC I encounter the next error:

unable to resolve package source ‘https //www.powershellgallery.com/api/v2/’

The reason is very simple – trying to install a PowerShell module behind a proxy?

Turns out it isn’t allowed through a proxy server, run this in a PowerShell session and try again:

$webclient=New-Object System.Net.WebClient
$webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredent
TAGGED:PowerShellWindowsWindows 10
Previous Article Office Insider 2002 for Windows
Next Article SCCM Error Checking the site
3 Comments 3 Comments
  • Andrew McAdam says:
    May 27, 2020 at 5:45 am

    You also need to run:
    [Net.ServicePointManager]::SecurityProtocol = “tls12”
    after these lines to make it work.
    At least I needed to.

    Reply
  • Juan R.G> says:
    June 25, 2020 at 4:21 pm

    Awesome , I was struggling with this for 2 hours , I though antivirus was blocking this but after running these lines it finally worked !!! thank you

    $webclient=New-Object System.Net.WebClient
    $webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    

    [Net.ServicePointManager]::SecurityProtocol = “tls12

    what exactly these lines do??

    Reply
    • Andrej Prijmak says:
      June 26, 2020 at 2:01 am

      Hi.
      [Net.ServicePointManager]::SecurityProtocol = “tls12 – will force TLS 1.2 as default in Powershell

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Translation

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
by Transposh - translation plugin for wordpress

Popular Posts

System Requirements for Windows Server 2016
Windows Server
Configuration Manager Query Collection List
Configuration Manager Query Collection List
ConfigMgr
Structured/Managed Navigation enabled on Modern Pages in Classic Team Sites
Tech
SCCM Failed to get DP locations as the expected version from MP
ConfigMgr

Recent Posts

Installing and Configuring Fail2ban for SSH Protection on Ubuntu 24.04
Linux
Enabling and Configuring FirewallD on AlmaLinux
Linux
User Creation and SSH Key Setup in AlmaLinux
Linux
How to reset password on AlmaLinux
Linux

© 2023 EnterinIT

Go to mobile version
adbanner
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?