We have an nuget server hosted in azure that only allow certain people to create packages.
If I run nuget command line, I get asked to provide username and password. Is there a possibility to provide username and password in command line?
I tried something such as -User or -UserName, but I get Unknown option: '-User'
nuget push -Source "XXX" -ApiKey VSTS -noninteractive mypackage.*.nupkg -User myUsername
Is there a way to provide credentials from command line?
Steps: Go to Control Panel -->User Account -->Credential Manager. In window credentials section update the password of your artifactory with encrypted password.
Globally: to make a credential provider available to all instances of nuget.exe run under the current user's profile, add it to %LocalAppData%\NuGet\CredentialProviders .
You have to change the NuGet.config you use. That is possible from the command line:
nuget sources add -Name "MyExample" -Source "XXX" -username "Y" -password "Z"
The password will be stored encrypted in the config file and can only be decrypted in the same user context as it was encrypted.
Use PAT (Personal Access Token) as the password. Make sure that PAT has packaging read and write permission.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With