PackageManagement - Register-PackageSource

This topic contains 4 replies, has 2 voices, and was last updated by  H Man 2 years, 7 months ago.

  • Author
  • #33185

    H Man

    Hello i am trying to register a fileshare location as a package source but am getting an error

    Register-PackageSource : Source location '\\server\Software\Chocolatey\Cho
    coRepo' is not valid for this provider

    $LANRepo  ='\\server\Software\Chocolatey\ChocoRepo'
    Register-PackageSource -Name 'LANRepo' -Location $LANRepo  -ProviderName Chocolatey -Trusted -Force -ForceBootstrap -Verbose
  • #33186

    Don Jones

    If all you have is the Chocolatey provider, then it only accepts the URL of a Chocolatey repo. It doesn't do file shares.

  • #33191

    H Man

    Ok Thanks Don

    the oneget module lets you use a file share as a source

    I have a nugget server using a file share I can use that thx again

  • #33192

    Don Jones

    Well, let's be precise about terminology. Just for people who come along later – I realize you probably know these things already.

    "OneGet" isn't a thing per se; it's "PowerShell Package Manager.""OneGet" was a very early pre-release name.

    And the PPM uses _providers_ to connect to repositories. The idea is that PPM can talk to any repository – NuGet, file shares, etc – if you have the right provider. Register-PackageSource has a -ProviderName parameter, which is where you tell it which provider to use. That's a mandatory parameter.

    Different providers accept different sources. For example, the Chocolatey provider is usually used with a URL (ideally HTTPS so that you can mutually authenticate the server).

  • #33201

    H Man

    thx Don well said

You must be logged in to reply to this topic.