From 87a3a23ee40d97bf48ab4ee174380182dd5af6f0 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 29 Aug 2025 12:35:53 -0700 Subject: [PATCH 1/9] Rename files to end with .Tests.ps1 --- ...SavePSResourceLocalTests.ps1 => SavePSResourceLocal.Tests.ps1} | 0 .../{SavePSResourceV2Tests.ps1 => SavePSResourceV2.Tests.ps1} | 0 .../{SavePSResourceV3Tests.ps1 => SavePSResourceV3.Tests.ps1} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test/SavePSResourceTests/{SavePSResourceLocalTests.ps1 => SavePSResourceLocal.Tests.ps1} (100%) rename test/SavePSResourceTests/{SavePSResourceV2Tests.ps1 => SavePSResourceV2.Tests.ps1} (100%) rename test/SavePSResourceTests/{SavePSResourceV3Tests.ps1 => SavePSResourceV3.Tests.ps1} (100%) diff --git a/test/SavePSResourceTests/SavePSResourceLocalTests.ps1 b/test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 similarity index 100% rename from test/SavePSResourceTests/SavePSResourceLocalTests.ps1 rename to test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 diff --git a/test/SavePSResourceTests/SavePSResourceV2Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 similarity index 100% rename from test/SavePSResourceTests/SavePSResourceV2Tests.ps1 rename to test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 diff --git a/test/SavePSResourceTests/SavePSResourceV3Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 similarity index 100% rename from test/SavePSResourceTests/SavePSResourceV3Tests.ps1 rename to test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 From 50ea37faea89a76af1e9c199d8253e520464b93d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 29 Aug 2025 12:44:34 -0700 Subject: [PATCH 2/9] Rename files to end with .Tests.ps1 and test fixes --- .../SavePSResourceLocal.Tests.ps1 | 13 +++++++------ test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 | 5 +++-- ...calTests.ps1 => UpdatePSResourceLocal.Tests.ps1} | 0 ...urceV2Tests.ps1 => UpdatePSResourceV2.Tests.ps1} | 0 ...urceV3Tests.ps1 => UpdatePSResourceV3.Tests.ps1} | 0 5 files changed, 10 insertions(+), 8 deletions(-) rename test/UpdatePSResourceTests/{UpdatePSResourceLocalTests.ps1 => UpdatePSResourceLocal.Tests.ps1} (100%) rename test/UpdatePSResourceTests/{UpdatePSResourceV2Tests.ps1 => UpdatePSResourceV2.Tests.ps1} (100%) rename test/UpdatePSResourceTests/{UpdatePSResourceV3Tests.ps1 => UpdatePSResourceV3.Tests.ps1} (100%) diff --git a/test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 index 36eb5330c..60b574975 100644 --- a/test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 @@ -96,7 +96,7 @@ Describe 'Test Save-PSResource for local repositories' -tags 'CI' { $pkgDirVersion = Get-ChildItem $pkgDir.FullName $pkgDirVersion.Name | Should -Be "1.0.0" } - + It "Should save resource given name and version '3.*'" { Save-PSResource -Name $moduleName -Version "3.*" -Repository $localRepo -Path $SaveDir -TrustRepository $pkgDir = Get-ChildItem -Path $SaveDir | Where-Object Name -eq $moduleName @@ -147,7 +147,7 @@ Describe 'Test Save-PSResource for local repositories' -tags 'CI' { Find-PSResource -Name $moduleName -Version "5.0.0" -Repository $localRepo | Save-PSResource -Path $SaveDir -TrustRepository $pkgDir = Get-ChildItem -Path $SaveDir | Where-Object Name -eq $moduleName $pkgDir | Should -Not -BeNullOrEmpty - (Get-ChildItem -Path $pkgDir.FullName) | Should -HaveCount 1 + (Get-ChildItem -Path $pkgDir.FullName) | Should -HaveCount 1 } It "Save module as a nupkg" { @@ -157,7 +157,7 @@ Describe 'Test Save-PSResource for local repositories' -tags 'CI' { } It "Save module, should search through all repositories and only install from the first repo containing the package" { - Save-PSResource -Name $moduleName3 -Version "0.0.93" -Path $SaveDir -TrustRepository -ErrorVariable ev + Save-PSResource -Name $moduleName3 -Version "0.0.93" -Path $SaveDir -TrustRepository -ErrorVariable ev $ev | Should -BeNullOrEmpty $pkgDir = Get-ChildItem -Path $SaveDir | Where-Object Name -eq "$moduleName3" $pkgDir | Should -Not -BeNullOrEmpty @@ -180,11 +180,11 @@ Describe 'Test Save-PSResource for local repositories' -tags 'CI' { } It "Save module via InputObject by piping from Find-PSResource" { - $modules = Find-PSResource -Name "*" -Repository $localRepo + $modules = Find-PSResource -Name "*" -Repository $localRepo $modules.Count | Should -BeGreaterThan 1 Save-PSResource -Path $SaveDir -TrustRepository -InputObject $modules - + $pkgDir = Get-ChildItem -Path $SaveDir $pkgDir | Should -Not -BeNullOrEmpty $pkgDir.Count | Should -BeGreaterThan 1 @@ -196,7 +196,8 @@ Describe 'Test Save-PSResource for local repositories' -tags 'CI' { $res = Save-PSResource -Name $moduleName -Version "5.0.0" -AuthenticodeCheck -Repository $localRepo -TrustRepository -Path $SaveDir -ErrorAction SilentlyContinue -ErrorVariable err -PassThru $res | Should -BeNullOrEmpty $err.Count | Should -Not -BeNullOrEmpty - $err[0].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" + $err[0].FullyQualifiedErrorId | Should -Contain "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" + $err[1].FullyQualifiedErrorId | Should -Contain "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" } It "Save module using -Quiet" { diff --git a/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 index 11dbb9688..eb15f06f9 100644 --- a/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 @@ -144,7 +144,8 @@ Describe 'Test HTTP Save-PSResource for V3 Server Protocol' -tags 'CI' { It 'Save module that is not authenticode signed' -Skip:(!(Get-IsWindows)) { Save-PSResource -Name $testModuleName -Version '5.0.0' -AuthenticodeCheck -Repository $NuGetGalleryName -TrustRepository -Path $SaveDir -ErrorVariable err -ErrorAction SilentlyContinue $err.Count | Should -BeGreaterThan 0 - $err[0].FullyQualifiedErrorId | Should -BeExactly 'GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource' + $err[0].FullyQualifiedErrorId | Should -Contain "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" + $err[1].FullyQualifiedErrorId | Should -Contain "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" } # Save resource that requires license @@ -155,7 +156,7 @@ Describe 'Test HTTP Save-PSResource for V3 Server Protocol' -tags 'CI' { $pkg.Name | Should -Be 'test_module_withlicense' $pkg.Version | Should -Be '1.0.0' } - + It "Save module and its dependencies" { $res = Save-PSResource 'TestModuleWithDependencyE' -Repository $NuGetGalleryName -TrustRepository -PassThru $res.Length | Should -Be 4 diff --git a/test/UpdatePSResourceTests/UpdatePSResourceLocalTests.ps1 b/test/UpdatePSResourceTests/UpdatePSResourceLocal.Tests.ps1 similarity index 100% rename from test/UpdatePSResourceTests/UpdatePSResourceLocalTests.ps1 rename to test/UpdatePSResourceTests/UpdatePSResourceLocal.Tests.ps1 diff --git a/test/UpdatePSResourceTests/UpdatePSResourceV2Tests.ps1 b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 similarity index 100% rename from test/UpdatePSResourceTests/UpdatePSResourceV2Tests.ps1 rename to test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 diff --git a/test/UpdatePSResourceTests/UpdatePSResourceV3Tests.ps1 b/test/UpdatePSResourceTests/UpdatePSResourceV3.Tests.ps1 similarity index 100% rename from test/UpdatePSResourceTests/UpdatePSResourceV3Tests.ps1 rename to test/UpdatePSResourceTests/UpdatePSResourceV3.Tests.ps1 From c7c54a7fd391fa4be3419be242718cb46fc0cb8a Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 29 Aug 2025 14:14:02 -0700 Subject: [PATCH 3/9] Fix tests --- test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 index 0141e3e30..d6a053351 100644 --- a/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 +++ b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 @@ -145,7 +145,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' { $isPkgUpdated = $false foreach ($pkg in $res) { - if ([System.Version]$pkg.Version -eq [System.Version]"3.0.0") + if ([System.Version]$pkg.Version -eq [System.Version]"3.0.0.0") { $isPkgUpdated = $true } @@ -174,7 +174,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' { It "Update resource to explicit prerelease version using NuGet syntax" { Install-PSResource -Name $testModuleName -Version "1.0.0.0" -Repository $PSGalleryName -TrustRepository - Update-PSResource -Name $testModuleName -Version "[5.2.5-alpha001]" -Prerelease -Repository $PSGalleryName -TrustRepository + Update-PSResource -Name $testModuleName -Version "5.2.5-alpha001" -Prerelease -Repository $PSGalleryName -TrustRepository $res = Get-InstalledPSResource -Name $testModuleName $res | Should -Not -BeNullOrEmpty $isPkgUpdated = $false @@ -427,6 +427,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' { Install-PSResource -Name "TestTestScript" -Version "1.0" -Repository $PSGalleryName -TrustRepository Update-PSResource -Name "TestTestScript" -Version "1.3.1.1" -AuthenticodeCheck -Repository $PSGalleryName -TrustRepository -ErrorVariable err -ErrorAction SilentlyContinue $err.Count | Should -Not -Be 0 - $err[0].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource" + $err[0].FullyQualifiedErrorId | Should -Contain "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource" + $err[1].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource" } } From 2c3cbd5819ef2a2aaccc8d7274a6a9da70e2d0e1 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 2 Sep 2025 18:31:42 -0700 Subject: [PATCH 4/9] Test fixes --- .../FindPSResourceRepositorySearching.Tests.ps1 | 2 +- test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 b/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 index c350d0051..f6b7738c9 100644 --- a/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 +++ b/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'Test Find-PSResource for searching and looping through repositories' - $tag2 = "Tag-Required-Script1-2.5" $cmdName = "Get-TargetResource" - $dscName = "SystemLocale" + $dscName = "SystemLocaleDsc" $tagsEscaped = @("'$tag1'", "'PSCommand_$cmdName'", "'PSDscResource_$dscName'") $cmdName2 = "Get-MyCommand" diff --git a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 index f00656b06..d50eabcd7 100644 --- a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 @@ -174,7 +174,7 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' { } It "Save script without using -IncludeXML" { - Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository | Should -Not -Throw + { Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository } | Should -Not -Throw $SavedScriptFile = Join-Path -Path $SaveDir -ChildPath "$testScriptName.ps1" Test-Path -Path $SavedScriptFile -PathType 'Leaf' | Should -BeTrue @@ -197,12 +197,13 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' { It "Save module that is not authenticode signed" -Skip:(!(Get-IsWindows)) { Save-PSResource -Name $testModuleName -Version "5.0.0" -AuthenticodeCheck -Repository $PSGalleryName -TrustRepository -Path $SaveDir -ErrorVariable err -ErrorAction SilentlyContinue $err.Count | Should -BeGreaterThan 0 - $err[0].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" + $err[0].FullyQualifiedErrorId | Should -Contain "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" + $err[1].FullyQualifiedErrorId | Should -Contain "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource" } # Save resource that requires license It "Save resource that requires accept license with -AcceptLicense flag" { - Save-PSResource -Repository $TestGalleryName -TrustRepository -Path $SaveDir ` + Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir ` -Name $testModuleName2 -AcceptLicense $pkg = Get-InstalledPSResource -Path $SaveDir -Name $testModuleName2 $pkg.Name | Should -Be $testModuleName2 From b257a2603d2d1a3c57f639a08c1a36413eaa2231 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Sep 2025 10:27:08 -0700 Subject: [PATCH 5/9] Update test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 --- .../FindPSResourceRepositorySearching.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 b/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 index f6b7738c9..c350d0051 100644 --- a/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 +++ b/test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'Test Find-PSResource for searching and looping through repositories' - $tag2 = "Tag-Required-Script1-2.5" $cmdName = "Get-TargetResource" - $dscName = "SystemLocaleDsc" + $dscName = "SystemLocale" $tagsEscaped = @("'$tag1'", "'PSCommand_$cmdName'", "'PSDscResource_$dscName'") $cmdName2 = "Get-MyCommand" From fbed4943ec0cab9253cee913a952f25d1d29abdf Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Sep 2025 12:07:04 -0700 Subject: [PATCH 6/9] Add debugging --- test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 index d6a053351..ec18029c8 100644 --- a/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 +++ b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 @@ -74,9 +74,11 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' { } It "Update resource installed given Name and Version (specific) parameters" { - Install-PSResource -Name $testModuleName -Version "1.0.0.0" -Repository $PSGalleryName -TrustRepository + $v1000 = Install-PSResource -Name $testModuleName -Version "1.0.0.0" -Repository $PSGalleryName -TrustRepository -Reinstall -PassThru + $v1000.Version | Should -Be "1.0.0.0" - Update-PSResource -Name $testModuleName -Version "5.0.0.0" -Repository $PSGalleryName -TrustRepository + $v5000 = Update-PSResource -Name $testModuleName -Version "5.0.0.0" -Repository $PSGalleryName -TrustRepository -PassThru -Force + $v5000.Version | Should -Be "5.0.0.0" $res = Get-InstalledPSResource -Name $testModuleName $res | Should -Not -BeNullOrEmpty $isPkgUpdated = $false From 688b41f115798bc5080b15f3aa246e4f7cf4b00f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Sep 2025 13:05:34 -0700 Subject: [PATCH 7/9] Fix tests --- test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 | 3 +-- test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 index d50eabcd7..b94b20335 100644 --- a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 @@ -203,8 +203,7 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' { # Save resource that requires license It "Save resource that requires accept license with -AcceptLicense flag" { - Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir ` - -Name $testModuleName2 -AcceptLicense + $pkg = Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir -Name $testModuleName2 -AcceptLicense -PassThru $pkg = Get-InstalledPSResource -Path $SaveDir -Name $testModuleName2 $pkg.Name | Should -Be $testModuleName2 $pkg.Version | Should -Be "0.0.1.0" diff --git a/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 index eb15f06f9..8078d28ca 100644 --- a/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceV3.Tests.ps1 @@ -149,10 +149,8 @@ Describe 'Test HTTP Save-PSResource for V3 Server Protocol' -tags 'CI' { } # Save resource that requires license - It 'Install resource that requires accept license with -AcceptLicense flag' { - Save-PSResource -Repository $NuGetGalleryName -TrustRepository -Path $SaveDir ` - -Name 'test_module_withlicense' -AcceptLicense - $pkg = Get-InstalledPSResource -Path $SaveDir 'test_module_withlicense' + It 'Save resource that requires accept license with -AcceptLicense flag' { + $pkg = Save-PSResource -Repository $NuGetGalleryName -TrustRepository -Path $SaveDir -Name 'test_module_withlicense' -AcceptLicense -PassThru $pkg.Name | Should -Be 'test_module_withlicense' $pkg.Version | Should -Be '1.0.0' } From c702047c4c5b10f125761163511999258a07cf7b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Sep 2025 13:08:09 -0700 Subject: [PATCH 8/9] Fix module version --- test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 index b94b20335..679d9ef71 100644 --- a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 @@ -13,6 +13,7 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' { $testScriptName = "test_script" $testModuleName2 = "testmodule99" $PackageManagement = "PackageManagement" + $testModuleNameWithLicense = "ModuleRequireLicenseAcceptance" Get-NewPSResourceRepositoryFile $SaveDir = Join-Path $TestDrive 'SavedResources' @@ -203,9 +204,9 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' { # Save resource that requires license It "Save resource that requires accept license with -AcceptLicense flag" { - $pkg = Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir -Name $testModuleName2 -AcceptLicense -PassThru - $pkg = Get-InstalledPSResource -Path $SaveDir -Name $testModuleName2 - $pkg.Name | Should -Be $testModuleName2 - $pkg.Version | Should -Be "0.0.1.0" + $pkg = Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir -Name $testModuleNameWithLicense -AcceptLicense -PassThru + $pkg = Get-InstalledPSResource -Path $SaveDir -Name $testModuleNameWithLicense + $pkg.Name | Should -Be $testModuleNameWithLicense + $pkg.Version | Should -Be "2.0.0.0" } } From 572c617ad7648c54d4f1b37b9b5fe0dc14ad1a93 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Sep 2025 15:12:53 -0700 Subject: [PATCH 9/9] More fixes --- test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 | 3 +-- test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 index 679d9ef71..ee350f91e 100644 --- a/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 +++ b/test/SavePSResourceTests/SavePSResourceV2.Tests.ps1 @@ -205,8 +205,7 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' { # Save resource that requires license It "Save resource that requires accept license with -AcceptLicense flag" { $pkg = Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir -Name $testModuleNameWithLicense -AcceptLicense -PassThru - $pkg = Get-InstalledPSResource -Path $SaveDir -Name $testModuleNameWithLicense $pkg.Name | Should -Be $testModuleNameWithLicense - $pkg.Version | Should -Be "2.0.0.0" + $pkg.Version | Should -Be "2.0" } } diff --git a/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 index ec18029c8..07db15035 100644 --- a/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 +++ b/test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1 @@ -78,7 +78,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' { $v1000.Version | Should -Be "1.0.0.0" $v5000 = Update-PSResource -Name $testModuleName -Version "5.0.0.0" -Repository $PSGalleryName -TrustRepository -PassThru -Force - $v5000.Version | Should -Be "5.0.0.0" + $v5000.Version | Should -Contain "5.0.0.0" $res = Get-InstalledPSResource -Name $testModuleName $res | Should -Not -BeNullOrEmpty $isPkgUpdated = $false