Install-Module not working is one of the most common roadblocks on a fresh Windows Server or a locked-down admin workstation. You type a simple command, PowerShell warns that it cannot resolve the package source, and the module you wanted never arrives. The good news about Install-Module not working: in most cases nothing is actually broken on the machine. Windows PowerShell 5.1 is simply talking to the PowerShell Gallery with the wrong TLS version, or it is missing a current NuGet provider. This guide walks through the fixes in the order that solves most cases fastest.
Why Install-Module Is Not Working: The Usual Suspects
Microsoft’s own troubleshooting page explains Install-Module not working like this: when Install-Module or Update-Module fails, it is usually a networking problem. The PowerShell Gallery requires TLS 1.2 or higher, so a session that negotiates an older protocol cannot connect (PowerShell Gallery troubleshooting). Four causes cover nearly every case:
- The session is not using TLS 1.2. Windows PowerShell 5.1 can fall back to an older protocol, and the Gallery rejects it.
- An outdated NuGet provider. PowerShellGet needs a current NuGet provider to talk to NuGet-based repositories.
- The built-in PowerShellGet 1.0.0.1 is still in place. Windows PowerShell ships with that version, and Microsoft says v1.x is no longer supported.
- A firewall or proxy blocks TCP port 443 to the Gallery endpoints.
Install-Module Not Working: What the Error Looks Like
The exact wording varies, but these are the messages people typically report. The first is the classic one on a server that has never been updated:
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'Microsoft.Graph'.
Try Get-PSRepository to see all available registered module repositories.Code language: JavaScript (javascript)Another common variant is WARNING: Package 'your package name' failed to download, which Microsoft documents directly. If your output resembles any of these, the steps below apply. The screenshot is an illustration of the typical output, not a capture from a specific server.

Step 1: Install-Module Not Working? Check Your PowerShell Version
When you hit Install-Module not working errors, start with what you are actually running. TLS problems almost always occur on Windows PowerShell 5.1, so confirm the version and the state of the package modules:
$PSVersionTable.PSVersion
$Names = @('PowerShellGet', 'PackageManagement', 'Microsoft.PowerShell.PSResourceGet')
Get-Module -Name $Names -ListAvailableCode language: PHP (php)On a new Windows PowerShell 5.1 system, Microsoft shows version 1.0.0.1 for both PowerShellGet and PackageManagement. If that is what you see, the machine needs the updates in the next steps before Install-Module can work reliably.
Step 2: Force TLS 1.2 in the Current Session
This is the single most effective fix for Install-Module not working on Windows PowerShell 5.1. Microsoft’s documented command adds TLS 1.2 to the protocols already allowed in the session:
[Net.ServicePointManager]::SecurityProtocol =
[Net.ServicePointManager]::SecurityProtocol -bor
[Net.SecurityProtocolType]::Tls12Code language: PHP (php)PowerShell Gallery TLS 1.2 is non-negotiable, so run it, then retry your install in the same window. The setting lasts only for that session, so add the line to your PowerShell profile if you want it applied every time. Microsoft recommends exactly that in the PowerShellGet installation guide.
Step 3: Fix Install-Module Not Working With a NuGet Provider Update
If TLS 1.2 alone does not help, install the current build of the NuGet provider. Microsoft’s troubleshooting page gives this command:
Install-PackageProvider NuGet -MinimumVersion 2.8.5.206 -ForceCode language: CSS (css)Skipping this step keeps Install-Module not working on clean servers, because PowerShellGet prompts you to install the provider on first use. In an unattended script that prompt can never be answered, so running Install-PackageProvider NuGet explicitly is the safer pattern. After it completes, check that it registered:
Get-PackageProvider -Name NuGet -ListAvailable
Step 4: Update PowerShellGet to Stop Install-Module Not Working
Microsoft states that if you run Windows PowerShell 5.1 you must upgrade to the latest PowerShellGet and PackageManagement. With TLS 1.2 enabled and NuGet in place, this works:
Install-Module PowerShellGet -Repository PSGallery -Force -AllowClobberInstalling PowerShellGet automatically pulls in the latest PackageManagement. Close PowerShell completely and open a new window afterward so the new module version loads. If you run PowerShell 7.4 or later, you also have Microsoft.PowerShell.PSResourceGet, the newer package manager, which you can use with Install-PSResource instead.
Step 5: Make TLS 1.2 Permanent With SchUseStrongCrypto
If every new session breaks again, set the .NET Framework strong crypto registry values so the OS defaults apply machine-wide. Microsoft documents SchUseStrongCrypto and SystemDefaultTlsVersions under the .NET Framework keys for v4.0.30319, with and without Wow6432Node (TLS best practices with .NET Framework). Run this from an elevated PowerShell prompt:
$paths = @(
"HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319"
)
foreach ($path in $paths) {
New-ItemProperty -Path $path -Name SchUseStrongCrypto -PropertyType DWord -Value 1 -Force | Out-Null
New-ItemProperty -Path $path -Name SystemDefaultTlsVersions -PropertyType DWord -Value 1 -Force | Out-Null
}Code language: PHP (php)Microsoft warns that these keys affect every application on the system, so apply them only on machines you control, and restart PowerShell afterward. They only influence client (outgoing) connections.
Step 6: Check the Network, Proxy and Endpoints
When the commands above are in place and you still see Install-Module not working, look at the network. Microsoft lists the endpoints that must be reachable on TCP port 443: cdn.oneget.org and cdn.powershellgallery.com for package discovery and download, plus *.powershellgallery.com, go.microsoft.com and aka.ms for the website and redirects. The old azureedge.net endpoints are no longer supported, so firewall rules that only allow them need updating. Test the connection directly:
Test-NetConnection -ComputerName cdn.powershellgallery.com -Port 443
Test-NetConnection -ComputerName cdn.oneget.org -Port 443Code language: CSS (css)If your environment uses an authenticated proxy, Install-Module and Install-PackageProvider accept -Proxy and -ProxyCredential parameters. You can also pass the current user’s credentials to the default proxy for the session:
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentialsCode language: PHP (php)Also check the Gallery status page on GitHub: Microsoft notes that an outage of the Gallery services can cause unexpected errors that no local change will cure.
Step 7: Re-Register PSGallery and Verify the Fix
If the repository entry itself looks damaged, Get-PSRepository will show it. A common last resort is to re-register the default repository, which restores the standard PSGallery entry:
Get-PSRepository
Unregister-PSRepository -Name PSGallery
Register-PSRepository -DefaultCode language: PHP (php)Now confirm that the Install-Module not working problem is gone. Installing for the current user avoids permission problems on a locked-down server:
Install-Module -Name Microsoft.Graph -Scope CurrentUser
Get-InstalledModule -Name Microsoft.GraphCode language: CSS (css)
If Get-InstalledModule returns the module with PSGallery as the repository, Install-Module not working is behind you. To avoid the untrusted repository prompt on later installs, you may also set the repository to trusted with Set-PSRepository -Name PSGallery -InstallationPolicy Trusted, but only do that if your security policy allows it.
Prevent Install-Module Not Working on New Servers
Bake the working sequence into your build scripts so you never hit this again: enable TLS 1.2, install the NuGet provider, update PowerShellGet, then install what you need. Each of these checks takes seconds, and doing them in order means Install-Module not working becomes a non-event for new servers and VDI images. If you are installing Graph modules next, our walkthroughs on how to install the Microsoft Graph PowerShell module and how to connect Microsoft Graph with PowerShell pick up right where this guide ends.
Read more: How To Install Microsoft Graph PowerShell Module
Read more: How to connect Microsoft Graph with PowerShell Best?
Read more: Get-MgSubscribedSku: 7 Things It Actually Tells You About Your Licenses
Why is Install-Module not working on Windows Server?
Most often the PowerShell session is not using TLS 1.2, which the PowerShell Gallery requires, or the NuGet provider and PowerShellGet are out of date. Enable TLS 1.2, install the NuGet provider and update PowerShellGet, then retry.
How do I fix “Unable to resolve package source”?
Run the TLS 1.2 command for the session, install the NuGet provider with Install-PackageProvider NuGet -MinimumVersion 2.8.5.206 -Force, and check that TCP port 443 to cdn.powershellgallery.com is open. If it persists, re-register PSGallery with Register-PSRepository -Default.
Does the TLS 1.2 command survive a restart of PowerShell?
No. The ServicePointManager setting applies only to the current session. Add it to your PowerShell profile, or set the SchUseStrongCrypto and SystemDefaultTlsVersions registry values under the .NET Framework v4.0.30319 keys to make it permanent.
Which firewall endpoints does Install-Module need?
Microsoft lists cdn.oneget.org and cdn.powershellgallery.com on TCP port 443 for package discovery and download, plus *.powershellgallery.com, go.microsoft.com and aka.ms for the website and redirects. The old azureedge.net endpoints are no longer supported.
Do I need PowerShellGet if I use PowerShell 7?
PowerShell 6 and later already include newer PowerShellGet and PackageManagement versions, and PowerShell 7.4 or later also includes Microsoft.PowerShell.PSResourceGet, the newer package manager. Windows PowerShell 5.1 is the version that usually needs the update.
References
Microsoft Learn: Troubleshooting cmdlets (PowerShell Gallery)
Microsoft Learn: Install a package manager for PowerShell
Microsoft Learn: Transport Layer Security (TLS) best practices with .NET Framework






