File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,24 @@ Describe 'Test CompatPowerShellGet: Update-PSResource' -tags 'CI' {
347
347
$res.Name | Should - Contain $testModuleName
348
348
$res.Version | Should - Contain " 3.0.0.0"
349
349
}
350
+
351
+ It " Update resource installed given -Name and -Force parameters" {
352
+ Install-PSResource - Name $testModuleName - Version " 1.0.0.0" - Repository $PSGalleryName - TrustRepository
353
+
354
+ Update-Module - Name $testModuleName - RequiredVersion " 3.0.0.0" - Foce
355
+ $res = Get-InstalledPSResource - Name $testModuleName
356
+
357
+ $isPkgUpdated = $false
358
+ foreach ($pkg in $res )
359
+ {
360
+ if ([System.Version ]$pkg.Version -gt [System.Version ]" 1.0.0.0" )
361
+ {
362
+ $isPkgUpdated = $true
363
+ }
364
+ }
365
+
366
+ $isPkgUpdated | Should - Be $true
367
+ }
350
368
}
351
369
352
370
# Ensure that PSGet v2 was not loaded during the test via command discovery
Original file line number Diff line number Diff line change @@ -2409,7 +2409,6 @@ param(
2409
2409
# Parameter Deletions (unsupported in v3)
2410
2410
if ( $PSBoundParameters [' Proxy' ] ) { $null = $PSBoundParameters.Remove (' Proxy' ) }
2411
2411
if ( $PSBoundParameters [' ProxyCredential' ] ) { $null = $PSBoundParameters.Remove (' ProxyCredential' ) }
2412
- if ( $PSBoundParameters [' Force' ] ) { $null = $PSBoundParameters.Remove (' Force' ) }
2413
2412
# END PARAMETER MAP
2414
2413
2415
2414
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (' Update-PSResource' , [System.Management.Automation.CommandTypes ]::Cmdlet)
@@ -2513,7 +2512,6 @@ param(
2513
2512
# Parameter Deletions (unsupported in v3)
2514
2513
if ( $PSBoundParameters [' Proxy' ] ) { $null = $PSBoundParameters.Remove (' Proxy' ) }
2515
2514
if ( $PSBoundParameters [' ProxyCredential' ] ) { $null = $PSBoundParameters.Remove (' ProxyCredential' ) }
2516
- if ( $PSBoundParameters [' Force' ] ) { $null = $PSBoundParameters.Remove (' Force' ) }
2517
2515
# END PARAMETER MAP
2518
2516
2519
2517
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (' Update-PSResource' , [System.Management.Automation.CommandTypes ]::Cmdlet)
You can’t perform that action at this time.
0 commit comments