Provide credentials in nuget command line options

We have a nuget server located in the azure region, which allows certain people to create packages.

If I ran the nuget command prompt, I was asked to provide a username and password. Is it possible to specify a username and password on the command line?

I tried something like -User or -UserName, but there was always an Unknown parameter: '-User'

nuget push -Source "XXX" -ApiKey VSTS -noninteractive mypackage.*.nupkg -User myUsername 

Is there a way to provide credentials from the commend line?

+5
source share
1 answer

You must change the NuGet.config used. This is possible from the command line :

 nuget sources add -Name "MyExample" -Source "XXX" -username "Y" -password "Z" 

The password will be encrypted in the configuration file and can only be decrypted in the same context of the user that was encrypted.

+7
source

Source: https://habr.com/ru/post/1263672/


All Articles