Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

PowerShellGet doesn't work with NuGet CredentialProviders #133

Description

@Jaykul

Microsoft's VisualStudio.com has started hosting NuGet Repositories, but the authentication scheme that they've chosen requires a nuget.exe credential provider plugin.

I was able to get this to work with PowerShellGet but only by directly calling the NuGet.exe which is installed by PowerShellGet to add the source with credentials.

Expected Behavior

  1. If Credentials are provided when Register-PSRepository is called, then
    PowerShellGet should store those credentials!
  2. If NuGet is present, and credentials are provided when Register-PSRepository is called, then PowerShellGet should also call nuget sources add with those credentials, to store the credentials for NuGet publishing.
  3. PowerShellGet should not specify -noninteractive on publishing unless there's a -noninteractive switch provided to the user. This terminally breaks authentication scenarios which require a credential provider.

Current Behavior

Register-PSRepository doesn't store credentials in any meaningful way.

Find-Module with authentication (like on VSTS repositories) requires the user to provide the credentials every time -- even when they were already provided in the call to Register-PSRepository

Publish-Module does not work with VSTS repositories, because they use a Credential Provider which requires prompting, even when the credentials are provided via the -Credential parameter.

Workaround

Users need to download the VSTS Credential Provider and put it next to the nuget.exe downloaded by PowerShellGet, and then call that specific nuget.exe sources add to register their repository with credentials. And then do it again, every 90 days.

See this gist

Activity

  1. Jaykul commented on May 24, 2017

    @Jaykul
    Author

    Since find and install work when passing -credential (although I shouldn't have to, since I passed it at registration time), I'm tempted to conclude that the credentials are simply not being passed at all when I'm trying to Publish-Module -Credential and that perhaps this could be fixed separately from the credential caching problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions