How to fix

Ruben Antonio Moreno Escalona 20 Reputation points Microsoft External Staff
2025-05-19T19:45:50.5533333+00:00

Hi Team

When we tried to install AzureAD using powershell, we received the following error message, we have checked and no firewall or internet policies are applied, if we go directly to the URL, we are able to download the file manually:

NuGet provider is required to continue PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\Adminaa9f1bc2eb\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''. WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7468 char:21 + ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ... +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception     + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider

 

PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name 'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7474 char:21 + ...     $null = PackageManagement\Import-PackageProvider -Name $script:Nu ... +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidData: (NuGet:String) [Import-PackageProvider], Exception     + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProvider

 

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''. WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try 'Get-PackageProvider -ListAvailable'. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7478 char:30 + ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ... +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvider], Exception     + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProvider

 

Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet provider is installed. At line:1 char:1 + Install-Module -Name AzureAD -Scope CurrentUser -Force -AllowClobber + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidOperation: (:) [Install-Module], InvalidOperationException     + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module

Could you please give me some insight, steps or workaround to be able to install AzureAD using Powershell, I don't know if it could be possible to install it using a MSI or EXE file, if yes please share the link with me.

Thanks

Ruben

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
25,026 questions
{count} votes

Accepted answer
  1. Mallikarjuna Vardham 430 Reputation points Microsoft External Staff Moderator
    2025-06-10T16:26:21.53+00:00

    Hi

    The issue was caused by outdated PowerShellGet and PackageManagement modules, which blocked the NuGet provider installation.

    Update the required modules

    Install-Module -Name PowerShellGet -Force -AllowClobber -Scope CurrentUser
    Install-Module -Name PackageManagement -Force -AllowClobber -Scope CurrentUser
    

    Restart PowerShell to apply the changes.

    After that, install the Microsoft Entra module using the following command

    Install-Module Microsoft.Entra -Scope CurrentUser -Force -AllowClobber
    

    Import the module (if needed):

    Import-Module Microsoft.Entra
    

    Then, connect to Microsoft Entra ID using the following command:

    Connect-MgGraph -Scopes "Directory.Read.All"
    

    Reference: https://learn.microsoft.com/en-us/powershell/gallery/powershellget/install-powershellget?view=powershellget-3.x&viewFallbackFrom=powershell-7.4


    Hope I was able to clear your query here. It would be great if you could kindly mark the answer as accepted so that anyone having similar query on MS Q&A forum can refer to it. Thanks.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.