Authorize feeds in all nuget.config files throughout the repo
This commit is contained in:
Родитель
35cd5a2502
Коммит
498b5e6a34
|
@ -46,14 +46,20 @@ if ($IsMacOS -or $IsLinux) {
|
|||
if ($AccessToken) {
|
||||
$endpoints = @()
|
||||
|
||||
$nugetConfig = [xml](Get-Content -Path "$PSScriptRoot\..\nuget.config")
|
||||
$endpointURIs = @()
|
||||
Get-ChildItem "$PSScriptRoot\..\nuget.config" -Recurse |% {
|
||||
$nugetConfig = [xml](Get-Content -Path $_)
|
||||
|
||||
$nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% {
|
||||
$endpoint = New-Object -TypeName PSObject
|
||||
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name endpoint -Value $_.value
|
||||
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name username -Value ado
|
||||
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name password -Value $AccessToken
|
||||
$endpoints += $endpoint
|
||||
$nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% {
|
||||
if ($endpointURIs -notcontains $_.Value) {
|
||||
$endpointURIs += $_.Value
|
||||
$endpoint = New-Object -TypeName PSObject
|
||||
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name endpoint -Value $_.value
|
||||
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name username -Value ado
|
||||
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name password -Value $AccessToken
|
||||
$endpoints += $endpoint
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$auth = New-Object -TypeName PSObject
|
||||
|
|
Загрузка…
Ссылка в новой задаче