Problem using Artifactory to mirror PowerShellGallery.com

Welcome Forums General PowerShell Q&A Problem using Artifactory to mirror PowerShellGallery.com

This topic contains 2 replies, has 1 voice, and was last updated by

 
Participant
6 months ago.

  • Author
    Posts
  • #102053

    Participant
    Points: 8
    Rank: Member

    I am trying to use Artifactory as a mirror for approved PowerShell modules hosted on PowerShellGallery.com. The connection from Artifactory to PowerShellGallery.com appears to be working, but I have been unable to get PowerShell clients to connect to the internal nuget repo. The URL I am using exactly matches the one Artifactory instructs to use, but PowerShell throws 'Repository location is not valid for this provider' and 'Unable to resolve module repository "(Artifactory URL)/api/nuget/vnuget"' warnings when I try to register it or subsequently run the 'Find-Module' cmdlet.

    At the end of the day I'm expecting that I can...
    1. Use PowerShell 5.0, 5.1, 6.0 to connect to the internal Artifactory NuGet repo
    2. When connecting, PowerShellGet and/or NuGet will automatically install or update as needed.
    a. Is PackageManagement the same as NuGet? My expectation is that 'nuget-anycpu.exe' installs as part of PackageMangement.

  • #102065

    Participant
    Points: 8
    Rank: Member

    I also sometimes receive an error message stating "The specified Uri '(Artifactory URL)/api/nuget/vnuget' for parameter 'SourceLocation' is an invalid Web Uri. Please ensure that it meets the Web Uri requirements.".

  • #102107

    Participant
    Points: 8
    Rank: Member

    Looks like our .NET security protocol settings differ from what our Artifactory is using. I found (https://johnlouros.com/blog/enabling-strong-cryptography-for-all-dot-net-applications) which looks like the right way to configure .NET settings, which is what PowerShell is pulling from.

    Adding all security protocols:

    $AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
    [System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols

The topic ‘Problem using Artifactory to mirror PowerShellGallery.com’ is closed to new replies.