ha what I have attempted? Well a couple of things already. Already tried the TLS but it didn´t worked. I also tried to manually install/import the nuget and poweshellget. Register the nuget package source location.
I had the exact same issue but I was attempting to install the MicrosoftTeams module on a Windows Server 2022. Once I had run:
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
@GilakOndrej-3552 · You can run save-module AzureAD -Path C:\temp on any working machine, copy the C:\temp\AzureAD folder to the non-working machine and run below command on the non-working machine to import the module:
Import-module C:\test\AzureAD
That way you can use the module without having to spend time on fixing the NuGet issue.
Hi @GilakOndrej-3552 · What is the OS? What version of Windows Management Framework you are using. If you don't have it installed please refer to https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/wmf/setup/install-configure?view=powershell-7. If you have WMF 5.0, try to uninstall that and install 5.1. If you are still facing the issue, try capturing network trace using netmon or wireshark to make sure that nuget.org traffic is not getting blocked. You can also try installing latest (pre-release) version of PowerShell from: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-rc.2/PowerShell-7.1.0-rc.2-win-x64.msi
Hi @AmanpreetSingh-MSFT I am using Windows 10 (2004) and I have WMF up to date
PS C:\WINDOWS\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.546
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.546
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
I´ll try capture the network soon. And I am able to use PS7, that is working fine.
@GilakOndrej-3552 · Here is the installer for latest release of PowerShell releaser: https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.msi.
If you don't want to use pre-release i.e., 7.1.0, you can use the latest release which is 7.0.3.
Read more: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7
Hi, no change :/
PS C:\WINDOWS\system32> $wc = New-Object System.Net.WebClient
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
PS C:\WINDOWS\system32> Install-Module azuread
PackageManagement\Install-Package : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\PSModule.psm1:9709 char:34
+ ... talledPackages = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
PS C:\WINDOWS\system32>
This might be due to the fact that TLS1.0 is no longer supported for psgallery.
You can read more here:
https://dev.to/darksmile92/powershell-disabled-support-for-tls-1-0-for-the-gallery-update-module-and-install-module-broken-1oii
You probably want to use these commando's (you might need to install powershellget again after that)
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Register-PSRepository -Default -Verbose
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted