Skip to content

Commit a7873b7

Browse files
committed
Update Dependency parsing logic to account for Az packages with Az* naming
1 parent cf7ee19 commit a7873b7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/code/PSResourceInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ public static bool TryConvertFromContainerRegistryJson(
972972
metadata["Dependencies"] = ParseContainerRegistryDependencies(requiredModulesElement, out errorMsg).ToArray();
973973
}
974974

975-
if (string.Equals(packageName, "Az", StringComparison.OrdinalIgnoreCase) || packageName.StartsWith("Az.", StringComparison.OrdinalIgnoreCase))
975+
if (string.Equals(packageName, "Az", StringComparison.OrdinalIgnoreCase) || string.Equals(packageName, "Azpreview", StringComparison.OrdinalIgnoreCase) || packageName.StartsWith("Az.", StringComparison.OrdinalIgnoreCase))
976976
{
977977
if (rootDom.TryGetProperty("ModuleList", out JsonElement moduleListDepsElement))
978978
{

test/FindPSResourceTests/FindPSResourceContainerRegistryServer.Tests.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,8 @@ Describe 'Test Find-PSResource for MAR Repository' -tags 'CI' {
266266
$res = Find-PSResource -Name "*" -Repository "MAR"
267267
$res | Should -Not -BeNullOrEmpty
268268
$res.Count | Should -BeGreaterThan 1
269+
It "Should find Azpreview resource and it's dependency given specific Name and Version" {
270+
$res = Find-PSResource -Name "Azpreview" -Version "13.2.0" -Repository "MAR"
271+
$res.Dependencies.Length | Should -Not -Be 0
269272
}
270273
}

0 commit comments

Comments
 (0)