Register-PSRepository and Register-PackageSource

This topic contains 1 reply, has 2 voices, and was last updated by  Jeremy Murrah 1 week, 4 days ago.

  • Author
    Posts
  • #81910

    Aurimas N.
    Participant

    Hi,
    to setup my internal powershell gallery I would use:

    Register-PSRepository -Name myPSgallery -SourceLocation https://myurl -PublishLocation https://myurl

    when and why I would want to run the following:

    Register-PackageSource -ProviderName PowerShellGet -Name myPSGallery -Location https://myurl2

    I'm not sure what it does exactly in this case? Is it adding additional location for packages to the one specified with -SourceLocation earlier or is this something else entirely?

  • #81911

    Jeremy Murrah
    Participant

    A PS Repository is sort of a subset of a package source using just the PowerShellGet Provider. If you run get-packagesource you'll see PSGallery listed with a ProviderName of PowerShellGet. If you register an internal powershell gallery via Register-PSRepository you'll see that listed in Get-PackageSource as well, also with a PowerShellGet Provider. If you're strictly dealing with powershell modules in your internal repository I don't believe you ever need to do anything with Register-PackageSource.

You must be logged in to reply to this topic.