Fix passing credential to the SyncGalleryToAzArtifacts.psm1 script (#8808)

Fix the parameter names and AzDevOps pipeline variable names.

## PR Context  

Variable names were out of sync with the definition on AzDevOps.
This commit is contained in:
Aditya Patwardhan 2019-02-02 13:55:54 -08:00 committed by Travis Plunk
parent 003a141f31
commit 22119a8afa
2 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,7 @@ steps:
- powershell: |
Import-Module -Force "$(Build.SourcesDirectory)/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1"
SyncGalleryToAzArtifacts -AzDevOpsPAT $(AzDevOpsPAT) -Destination $(Build.ArtifactStagingDirectory)
SyncGalleryToAzArtifacts -AzDevOpsFeedUserName $(AzDevOpsFeedUserName) -AzDevOpsPAT $(AzDevOpsFeedPAT) -Destination $(Build.ArtifactStagingDirectory)
displayName: Download packages from PSGallery that need to be updated
condition: succeededOrFailed()

View file

@ -14,6 +14,7 @@ Path to the folder where the packages should be stored for uploading to Azure De
#>
function SyncGalleryToAzArtifacts {
param(
[Parameter(Mandatory = $true)] [string] $AzDevOpsFeedUserName,
[Parameter(Mandatory = $true)] [string] $AzDevOpsPAT,
[Parameter(Mandatory = $true)] [string] $Destination
)
@ -28,7 +29,7 @@ function SyncGalleryToAzArtifacts {
$galleryUrl = 'https://www.powershellgallery.com/api/v2/'
$azArtifactsUrl = 'https://mscodehub.pkgs.visualstudio.com/_packaging/pscore-release/nuget/v2'
$azDevOpsCreds = [pscredential]::new($env:AzDevOpsUserName, (ConvertTo-SecureString -String $AzDevOpsPAT -AsPlainText -Force))
$azDevOpsCreds = [pscredential]::new($AzDevOpsFeedUserName, (ConvertTo-SecureString -String $AzDevOpsPAT -AsPlainText -Force))
foreach ($package in $packages) {
try {