Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit b8d310f

Browse files
+ fixing Install-UpliftPSModule method, -SkipPublisherCheck flag
1 parent c6393f6 commit b8d310f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

uplift.core/src/Uplift.Core.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,11 @@ function Install-UpliftPSModule {
529529

530530
while ( ($attempt -le $maxAttempt) -and (-not $success) ) {
531531

532+
$oldProgressPreference = $progressPreference
533+
532534
try {
535+
$progressPreference = 'silentlyContinue'
536+
533537
Write-UpliftMessage "`t[$attempt/$maxAttempt] ensuring package: $name $version"
534538
$existinModule = $null
535539

@@ -548,9 +552,9 @@ function Install-UpliftPSModule {
548552
Write-UpliftMessage "`t`tpackage does not exist, installing: $name $version"
549553

550554
if ([System.String]::IsNullOrEmpty($version) -eq $true) {
551-
Install-Module -Name $name -Force;
555+
Install-Module -Name $name -Force -SkipPublisherCheck
552556
} else {
553-
Install-Module -Name $name -RequiredVersion $version -Force;
557+
Install-Module -Name $name -RequiredVersion $version -Force -SkipPublisherCheck
554558
}
555559
}
556560

@@ -563,6 +567,8 @@ function Install-UpliftPSModule {
563567
Write-UpliftMessage "`t[$attempt/$maxAttempt] error was: $exception"
564568

565569
$attempt = $attempt + 1
570+
} finally {
571+
$progressPreference = $oldProgressPreference
566572
}
567573
}
568574

0 commit comments

Comments
 (0)