PowerShellGet doesn't work with NuGet CredentialProviders #133
Description
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
- If Credentials are provided when
Register-PSRepository
is called, then
PowerShellGet should store those credentials! - 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. - 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.