Skip to content

Commit fd0135a

Browse files
committed
Add skill configure-telerik-nuget
1 parent a90be91 commit fd0135a

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

  • .github/skills/configure-telerik-nuget
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: configure-telerik-nuget
3+
description: Helps setup, configure and manage Telerik NuGet feeds in your repo's nuget.config file.
4+
---
5+
6+
Use these helper functions to manage Telerik NuGet source configuration.
7+
8+
Get a new api key at https://www.telerik.com/account/downloads/api-keys
9+
10+
## Function: configure
11+
12+
Adds the Telerik feed when missing, or updates credentials/source settings when the same source URL already exists.
13+
14+
```powershell
15+
function Configure-TelerikNuGetSource {
16+
param(
17+
[Parameter(Mandatory = $true)]
18+
[string]$ApiKey,
19+
20+
[string]$SourceName = "Telerik_NuGet_Server",
21+
[string]$SourceUrl = "https://nuget.telerik.com/v3/index.json"
22+
)
23+
24+
$existingSourcesOutput = dotnet nuget list source | Out-String
25+
26+
if ($existingSourcesOutput -match [regex]::Escape($SourceUrl)) {
27+
dotnet nuget update source "$SourceName" --source "$SourceUrl" --username "api-key" --password "$ApiKey" --store-password-in-clear-text
28+
Write-Host "A NuGet package source with URL '$SourceUrl' already exists. Updated source '$SourceName'."
29+
return
30+
}
31+
32+
dotnet nuget source add --name "$SourceName" --source "$SourceUrl" --username "api-key" --password "$ApiKey" --store-password-in-clear-text
33+
34+
Write-Host "Added Telerik NuGet source '$SourceName' at '$SourceUrl'."
35+
}
36+
```
37+
38+
Example usage:
39+
40+
```powershell
41+
Configure-TelerikNuGetSource -ApiKey "<telerik-api-key>"
42+
```

0 commit comments

Comments
 (0)