Skip to content

Commit b11eb71

Browse files
committed
Dynamic param should not appear when using Repositories param set, comment out cred provider tests
1 parent 2644183 commit b11eb71

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.403"
3+
"version": "8.0.404"
44
}
55
}

src/code/RegisterPSResourceRepository.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ class RegisterPSResourceRepository : PSCmdlet, IDynamicParameters
118118
public object GetDynamicParameters()
119119
{
120120
// Dynamic parameter '-CredentialProvider' should not appear for PSGallery, or any container registry repository.
121-
if (ParameterSetName.Equals("PSGalleryParameterSet") || Uri.EndsWith(".azurecr.io") || Uri.EndsWith(".azurecr.io/") || Uri.Contains("mcr.microsoft.com"))
121+
// It should also not appear when using the 'Repositories' parameter set.
122+
if (ParameterSetName.Equals(PSGalleryParameterSet) ||
123+
ParameterSetName.Equals(RepositoriesParameterSet) ||
124+
Uri.EndsWith(".azurecr.io") || Uri.EndsWith(".azurecr.io/") || Uri.Contains("mcr.microsoft.com"))
122125
{
123126
return null;
124127
}

test/CredentialProvider.Tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Describe 'Test Azure Artifacts Credential Provider' -tags 'CI' {
2222

2323
Get-RevertPSResourceRepositoryFile
2424
}
25-
25+
<#
2626
It "Find resource given specific Name and Repository" {
2727
$res = Find-PSResource -Name $TestModuleName -Repository $ADORepoName -Verbose
2828
$res.Name | Should -Be $TestModuleName
@@ -71,4 +71,5 @@ Describe 'Test Azure Artifacts Credential Provider' -tags 'CI' {
7171
$repo = Get-PSResourceRepository -Name $ADORepoName
7272
$repo.CredentialProvider | Should -Be "None"
7373
}
74+
#>
7475
}

0 commit comments

Comments
 (0)