locked
Install-PackageProvider : No match was found RRS feed

  • Question

  • Install-PackageProvider : No match was found for the specified search criteria for the provider 'ContainerImage'. The
    package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.

    I am behind a proxy. The requests get to the internet (I can see them pass through the configured proxy and contact oneget.og). But since everything is HTTPS, I can't get more information about what's going on.

    Running the TP5 install-containerhost.ps1 doesn't improve the situation.

    As a workaround, may I ask you the URI of the WIM?

    Thursday, April 28, 2016 9:57 AM

Answers

  • The command described by Ryan Bijkerk, on this thread has solved my problems. I copy it here for the sake of lazyness, but all the credits should go to Ryan and StonesBG (who posted it on StackOverflow).

    "I ran into the same issue with TP5 and the following command solved my issue:

    Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted

    Thanks Stonesbg!

    Cheers,

    Ryan"

    Dear Microsoft guys, how's that possible that this gallery is not registered by default? Is this gallery legit?

    • Marked as answer by nilleb Monday, May 2, 2016 7:45 AM
    Monday, May 2, 2016 7:44 AM

All replies

  • While reading the script

    https://github.com/PowerShell/ContainerProvider/blob/development/ContainerImage.psm1

    I have found the URI

    http://go.microsoft.com/fwlink/?LinkID=746630&clcid=0x409

    This link contains the paths to the last (TP5) WIMs:

    [
        {
            "Name":  "NanoServer",
            "Version":  "10.0.14300.1010",
            "Description":  "Container OS Image of Windows Server 2016 Technical Preview 5 : Nano Server Installation",
            "SasToken":  "https://az887518.vo.msecnd.net/pshctcontainer/NanoServer-10-0-14300-1010.wim"
        },
        {
            "Name":  "WindowsServerCore",
            "Version":  "10.0.14300.1000",
            "Description":  "Container OS Image of Windows Server 2016 Technical Preview 5 : Windows Server Core Installation",
            "SasToken":  "https://az887518.vo.msecnd.net/pshctcontainer/WindowsServerCore-10-0-14300-1000.wim"
        }
    ]
    

    The first of the two links corresponds to the one in the screenshot taken by stefan scherer (https://twitter.com/stefscherer/status/725417665104334849).

    So far, to install the base images in a bricolage fashion

        > invoke-webrequest -uri oneOfTheTwoUrisAbove -outfile downloadedImage.wim
        > Install-ContainerOsImage -WimPath downloadedImage.wim


    • Edited by nilleb Thursday, April 28, 2016 12:31 PM syntax highlighting
    Thursday, April 28, 2016 12:29 PM
  • As requested by Quoc Truong on a GitHub issue, here is the output of some powershell commands:

    When the system is configured to use an authenticated proxy (i.e. a proxy offering Negotiate, NTLM to identify the user):

    PS C:\Users\nilleb> Get-PackageProvider nuget Get-PackageProvider : Unable to find package provider 'nuget'. It may not be imported yet. Try 'Get-PackageProvider -ListAvailable'. At line:1 char:1 + Get-PackageProvider nuget + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvi der], Exception + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka geProvider PS C:\Users\nilleb> Find-PackageProvider ContainerImage -Verbose VERBOSE: Using the provider 'Bootstrap' for searching packages. VERBOSE: Finding the package 'Bootstrap::FindPackage' 'ContainerImage','','','''. VERBOSE: Using the provider 'PowerShellGet' for searching packages. VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories. Find-PackageProvider : No match was found for the specified search criteria and package name 'ContainerImage'. Try Get-PackageSource to see all available registered package sources. At line:1 char:1 + Find-PackageProvider ContainerImage -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:FindPackageProvider) [Find-PackagePro vider], Exception + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackageProvid er PS C:\Users\nilleb> Find-Module ContainerImage -Verbose 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\bellinsalarin\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 VERBOSE: Installing NuGet provider. VERBOSE: Using the provider 'Bootstrap' for searching packages. VERBOSE: Finding the package 'Bootstrap::FindPackage' 'NuGet','','2.8.5.201','''. VERBOSE: Unable to download from URI 'https://oneget.org/nuget-2.8.5.204.package.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nuget-2.8.5.204.package.swidtag', retrying for '2' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nuget-2.8.5.204.package.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nuget-2.8.5.204.package.swidtag', retrying for '1' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nuget-2.8.5.204.package.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nuget-2.8.5.204.package.swidtag', retrying for '0' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nugetv2.feed.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nugetv2.feed.swidtag', retrying for '2' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nugetv2.feed.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nugetv2.feed.swidtag', retrying for '1' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nugetv2.feed.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nugetv2.feed.swidtag', retrying for '0' more times. VERBOSE: Using the provider 'PowerShellGet' for searching packages. VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories. 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:6679 char:21 + ... $null = PackageManagement\Install-PackageProvider -Name $script:N ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac kageProvider], Exception + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro vider 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:6685 char:21 + ... $null = PackageManagement\Import-PackageProvider -Name $script:Nu ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv ider VERBOSE: 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. VERBOSE: Finding the package 'Bootstrap::FindPackage' 'NuGet','','0.0.0.1','''. VERBOSE: Unable to download from URI 'https://oneget.org/nuget-2.8.5.204.package.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nuget-2.8.5.204.package.swidtag', retrying for '2' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nuget-2.8.5.204.package.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nuget-2.8.5.204.package.swidtag', retrying for '1' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nuget-2.8.5.204.package.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nuget-2.8.5.204.package.swidtag', retrying for '0' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nugetv2.feed.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nugetv2.feed.swidtag', retrying for '2' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nugetv2.feed.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nugetv2.feed.swidtag', retrying for '1' more times. VERBOSE: Unable to download from URI 'https://oneget.org/nugetv2.feed.swidtag' to ''. VERBOSE: Cannot download link 'https://oneget.org/nugetv2.feed.swidtag', retrying for '0' more times. 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:6689 char:30 + ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvi der], Exception + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka geProvider Find-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 + Find-Module ContainerImage -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Find-Module], InvalidOperationException + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Find-Module

    When the system is configured to use a non-authenticated proxy (i.e. a non  transparent proxy that doesn't ask for an authentication)

    PS C:\Users\nilleb> Get-PackageProvider nuget
    
    The provider 'nuget v2.8.5.204' is not installed.
    nuget may be manually downloaded from https://oneget.org/Microsoft.PackageManagement.NuGetProvider-2.8.5.204.dll and
    installed.
    Would you like PackageManagement to automatically download and install 'nuget' now?
    [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):
    
    Name                     Version          DynamicOptions
    ----                     -------          --------------
    NuGet                    2.8.5.204        Destination, ExcludeVersion, Scope, Headers, FilterOnTag, Contains, AllowP...
    
    
    PS C:\Users\nilleb> Find-PackageProvider ContainerImage -Verbose
    VERBOSE: Using the provider 'Bootstrap' for searching packages.
    VERBOSE: Finding the package 'Bootstrap::FindPackage' 'ContainerImage','','','''.
    VERBOSE: Using the provider 'PowerShellGet' for searching packages.
    VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
    Find-PackageProvider : No match was found for the specified search criteria and package name 'ContainerImage'. Try
    Get-PackageSource to see all available registered package sources.
    At line:1 char:1
    + Find-PackageProvider ContainerImage -Verbose
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Microsoft.Power...PackageProvider:FindPackageProvider) [Find-PackagePro
       vider], Exception
        + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackageProvid
       er
    
    PS C:\Users\nilleb> Find-Module ContainerImage -Verbose
    VERBOSE: Using the provider 'PowerShellGet' for searching packages.
    VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
    PackageManagement\Find-Package : No match was found for the specified search criteria and module name
    'ContainerImage'. Try Get-ModuleRepository to see all available registered module repositories.
    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1053 char:3
    +         PackageManagement\Find-Package @PSBoundParameters | Microsoft ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exceptio
       n
        + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage

    • Edited by nilleb Monday, May 2, 2016 7:28 AM add non-authenticated proxy details
    Monday, May 2, 2016 7:24 AM
  • The command described by Ryan Bijkerk, on this thread has solved my problems. I copy it here for the sake of lazyness, but all the credits should go to Ryan and StonesBG (who posted it on StackOverflow).

    "I ran into the same issue with TP5 and the following command solved my issue:

    Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted

    Thanks Stonesbg!

    Cheers,

    Ryan"

    Dear Microsoft guys, how's that possible that this gallery is not registered by default? Is this gallery legit?

    • Marked as answer by nilleb Monday, May 2, 2016 7:45 AM
    Monday, May 2, 2016 7:44 AM
  • Hi,

    PSRepository "PSGallery" should have been registered by default. May I know the build number on which you had to run "Registry-PSRepository" cmdlet as described above ? The Repository PSGallery can be unregistered. It would be great to know if you have edited the repository .xml file or if you have upgraded from an earlier.

    Regarding the problem downloading behind a proxy, this is a known issue and we are working to resolve it.

    @nilleb posted links to the container images above. You can use those links with Start-BITSTranfer powershell cmdlet which supports proxy credentials

    Thanks

    Krishna

    Monday, May 2, 2016 10:19 PM
  • Build 14300.rs1_release_svc.160415-2143

    I haven't edited repository.xml, and this is a fresh install.

    Is the repository.xml a user file, or a system file? Because I am NOT using Administrator (builtin account), but a domain user (who belongs to the Administrators group).

    Wednesday, May 4, 2016 9:12 AM
  • Im having the same issue with the proxy... whats the fix for that?

    Tried several things but no luck so far...

    Tuesday, February 14, 2017 1:03 PM
  • thanks mate. that fixed the issue of not finding the module.

    Can't believe this is not mentioned explicitly on the powershellgallery instructions.

    Thursday, April 6, 2017 2:21 AM
  • It doesn't register by default if you are behind a proxy - that's my problem, and seemingly many of us. Honestly, how many IT professionals aren't working behind some kind of proxy?

    For the problem you acknowledge with "downloading behind a proxy", if it is a known issue, why is it not described anywhere in the documentation for installing the PSGallery add-ons?

    For a proper workaround for this (where does BITS come into this?), I found some actually useful info here: https://gist.github.com/guitarrapc/79d31b8cd02649075642b77c4ae796ab

    In your PowerShell session, add the following parameters:

    [system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://[YourProxyDNS]:[yourProxyPort]') 
    [system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    [system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true 

    Once this is done, 'Register-PSRepository -Name PSGallery' works (it failed the first time without the proxy configuration), and the NuGet download/installation then executes.

    Thursday, September 14, 2017 6:02 AM
  • I found i needed to do this 
    Register-PSRepository -Default


    for later updates of WS2016

    • Edited by juxstar Thursday, July 23, 2020 5:36 AM
    Thursday, July 23, 2020 5:35 AM
  • By Chance,

    Would anyone know a workaround for a machine that has no access to the internet?   Presumable a location where a manual download takes place, then the file is transferred via a DMZ or some similar transport, the file is placed in the %ProgramData%\Microsoft\Windows\PowerShell\PowerShellGet folder, and magic transpires that allows PowerShell to see the Package, like nuget or maybe the Get-PSRepository runs or maybe ???

    If I run list available - I downloaded Nuget Manually and installed it to the folder above as well as the PackageManagement\ProviderAssemblies\nuget … I see the nuget packages for 2.8.5.201 and 2.8.5.208 that are placed there manually.   I believe there is a way to register them.

    "Publish-Module -Name NuGet"  Returns the error "No match was found for the specified search criteria and provider name 'NuGet'.

    Running out of ideas and just about everything googled so far, points to "open up the internet and it will work magically".   

    I'd like to avoid that risk.


    • Edited by krakdcorn Sunday, July 26, 2020 7:20 PM
    Sunday, July 26, 2020 7:16 PM