File tree Expand file tree Collapse file tree
test/UninstallPSResourceTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,16 +236,18 @@ Describe 'Test Uninstall-PSResource for Modules' -tags 'CI' {
236236 }
237237
238238 It " Write warning when using -Prerelease flag with only stable versions installed" {
239- # Install a stable version
240- Install-PSResource - Name $testModuleName - Version " 5.0.0.0" - Repository $PSGalleryName - TrustRepository
239+ # BeforeEach already installs a stable version of $testModuleName (5.0.0.0)
240+ # Verify it's installed
241+ $pkg = Get-InstalledPSResource $testModuleName
242+ $pkg | Should -Not - BeNullOrEmpty
241243
242244 # Try to uninstall with -Prerelease flag, should show warning
243245 Uninstall-PSResource - Name $testModuleName - Prerelease - SkipDependencyCheck - WarningVariable warn - WarningAction SilentlyContinue
244246
245- # Module should still be present
246- $res = Get-InstalledPSResource - Name $testModuleName - Version " 5.0.0.0"
247+ # Module should still be present since no prerelease versions were found
248+ $res = Get-InstalledPSResource - Name $testModuleName
249+ $res | Should -Not - BeNullOrEmpty
247250 $res.Name | Should - Be $testModuleName
248- $res.Version | Should - Be " 5.0.0.0"
249251
250252 # Warning should have been written
251253 $warn.Count | Should - Be 1
You can’t perform that action at this time.
0 commit comments