Skip to content

Commit abaf606

Browse files
authored
Register PSRepository Failing (#396)
* UnRegister Source before Registering
1 parent 3458257 commit abaf606

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.azure-pipelines/install-tools-template.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,18 @@ steps:
5757
inputs:
5858
targetType: inline
5959
pwsh: true
60+
errorActionPreference: 'continue'
6061
script: |
6162
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Continue
6263
Get-PSRepository
6364
$patToken = '$(NUGETFEEDKEY)' | ConvertTo-SecureString -AsPlainText -Force
6465
$nugetFeed = '$(NUGETFEED)'
6566
$user = '$(NUGETBUILDUSER)'
6667
$credsAzureDevopsServices = New-Object System.Management.Automation.PSCredential($user, $patToken)
67-
Register-PackageSource -Name 'LocalNugetPackageSource' -Location $nugetFeed -SkipValidate -Trusted -Verbose -ProviderName 'Nuget'
68-
Register-PSRepository -Name 'LocalNugetFeed' -SourceLocation $nugetFeed -PublishLocation $nugetFeed -InstallationPolicy Trusted -Credential $credsAzureDevopsServices -PackageManagementProvider 'Nuget'
68+
UnRegister-PackageSource -Name 'LocalNugetPackageSource' -ErrorAction Continue
69+
UnRegister-PSRepository -Name 'LocalNugetFeed' -ErrorAction Continue
70+
Register-PackageSource -Name 'LocalNugetPackageSource' -Location $nugetFeed -SkipValidate -Trusted -Verbose -ProviderName 'Nuget' -ErrorAction Continue
71+
Register-PSRepository -Name 'LocalNugetFeed' -SourceLocation $nugetFeed -PublishLocation $nugetFeed -InstallationPolicy Trusted -Credential $credsAzureDevopsServices -PackageManagementProvider 'Nuget' -ErrorAction Continue
6972
Get-PSRepository
7073
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Credential $credsAzureDevopsServices -AllVersions -Repository 'LocalNugetFeed'
71-
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Repository 'LocalNugetFeed'
74+
Find-Module -Name Microsoft.Graph.Authentication -AllowPrerelease -Repository 'LocalNugetFeed'

0 commit comments

Comments
 (0)