Skip to content

Commit e1c9b8c

Browse files
committed
monikers
1 parent 77582d1 commit e1c9b8c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

docs/artifacts/nuget/nuget-exe.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ NuGet 4.8.2 and later supports the Azure Artifacts Credential Provider, which au
5454

5555
::: moniker-end
5656

57-
Then, run any [NuGet command](/nuget/tools/nuget-exe-cli-reference).
58-
5957
::: moniker range="<= tfs-2018 || azure-devops"
6058

6159
## Add a feed to NuGet 2
@@ -81,17 +79,23 @@ To use a 2.x client, first get the v3 feed URL:
8179
>![NuGet Package source URL in the Connect to feed dialog](../media/nuget-consume-url-azure-devops-newnav.png)
8280
>
8381
84-
Then, at the end of the URL, replace `/v3/index.json` with `/v2`.
82+
Then replace `/v3/index.json` with `/v2`.
8583

8684
[!INCLUDE [generate-pat](../includes/generate-pat.md)]
8785

88-
Run
86+
Run the following command in an elevated command prompt window to add a NuGet package source:
8987

9088
```Command
91-
nuget sources add -name {your feed name} -source {your feed URL} -username {anything} -password {your PAT}
89+
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Any_String_But_Not_Null> -password <Personal_Access_Token>
9290
```
9391

94-
Then, run any [NuGet command](/nuget/tools/nuget-exe-cli-reference).
92+
If your organization is connected to Azure Active Directory, you must first authenticate with your AD credentials, and then add your personal access token using the *setapikey* command:
93+
94+
```Command
95+
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Azure_Active_Directory_UserName> -password <Azure_Active_Directory_Password>
96+
97+
nuget setapikey <Personal_Access_Token> -source <Feed_URL>
98+
```
9599

96100
::: moniker-end
97101

@@ -112,7 +116,7 @@ To use a 2.x client, first get the v3 feed URL:
112116
![NuGet Package source URL in the Connect to feed dialog](../media/nuget-consume-url.png)
113117

114118

115-
Then, replace `/v3/index.json` with `/v2`.
119+
Then replace `/v3/index.json` with `/v2`.
116120

117121
[!INCLUDE [generate-pat](../includes/generate-pat.md)]
118122

@@ -130,4 +134,4 @@ nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Azure_Active_D
130134
nuget setapikey <Personal_Access_Token> -source <Feed_URL>
131135
```
132136

133-
::: moniker-end
137+
::: moniker-end

0 commit comments

Comments
 (0)