File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
test/UninstallPSResourceTests Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -236,16 +236,18 @@ Describe 'Test Uninstall-PSResource for Modules' -tags 'CI' {
236
236
}
237
237
238
238
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
241
243
242
244
# Try to uninstall with -Prerelease flag, should show warning
243
245
Uninstall-PSResource - Name $testModuleName - Prerelease - SkipDependencyCheck - WarningVariable warn - WarningAction SilentlyContinue
244
246
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
247
250
$res.Name | Should - Be $testModuleName
248
- $res.Version | Should - Be " 5.0.0.0"
249
251
250
252
# Warning should have been written
251
253
$warn.Count | Should - Be 1
You can’t perform that action at this time.
0 commit comments