PackageManagement - Register-PackageSource

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of H Man H Man 1 year, 5 months ago.

  • Author
    Posts
  • #33185
    Profile photo of H Man
    H Man
    Participant

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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
    Profile photo of H Man
    H Man
    Participant

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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
    Profile photo of H Man
    H Man
    Participant

    thx Don well said

You must be logged in to reply to this topic.