I want to add a nuget package feed that is hosted on our TFS instance to all of our developer's workstations. The problem that I have is that if the source has already been added, I get an error stating
The name specified has already been added to the list of available package sources. Please provide a unique name.
What I want to do is check if a nuget source has already been registered on the machine before I run the code to add the source. Checking the documentation for nuget.exe I tried to use the List
operation along with the Name
and Source
but I just get the same result as if I just run nuget sources
All of these commands:
nuget sources list -Source $myURL
nuget sources list -Name $myName
nuget sources
Return the same result:
Registered Sources:
1. nuget.org [Enabled]
https://api.nuget.org/v3/index.json
2. myPowershellFeed [Enabled]
https://myURL.myDomain.org
I am using Powershell to run these commands and came up with a workaround, but ideally I am hoping there is a nuget.exe command line option that will get this info for me.