Skip to content

Commit cbb5570

Browse files
authored
Specify the Winget package version to avoid issues with prerelease versions (#118)
1 parent dd384d6 commit cbb5570

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tasks/winget/main.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ function InstallWinGet {
164164
# check if the Microsoft.Winget.Client module is installed
165165
$wingetClientPackage = Get-Module -ListAvailable -Name Microsoft.WinGet.Client | Where-Object { $_.Version -ge "1.9.2411" }
166166
if (!($wingetClientPackage)) {
167-
Write-Host "Installing Microsoft.Winget.Client"
168-
Install-Module Microsoft.WinGet.Client -Scope $PsInstallScope
169-
pwsh.exe -MTA -Command "Install-Module Microsoft.WinGet.Client -Scope $PsInstallScope"
167+
Write-Host "Installing Microsoft.Winget.Client -RequiredVersion 1.9.25190"
168+
Install-Module Microsoft.WinGet.Client -Scope $PsInstallScope -RequiredVersion 1.9.25190
169+
pwsh.exe -MTA -Command "Install-Module Microsoft.WinGet.Client -Scope $PsInstallScope -RequiredVersion 1.9.25190"
170170
Write-Host "Done Installing Microsoft.Winget.Client"
171171
}
172172
else {
@@ -177,7 +177,7 @@ function InstallWinGet {
177177
$wingetConfigurationPackage = Get-Module -ListAvailable -Name Microsoft.WinGet.Configuration | Where-Object { $_.Version -ge "1.8.1911" }
178178
if (!($wingetConfigurationPackage)) {
179179
Write-Host "Installing Microsoft.WinGet.Configuration"
180-
pwsh.exe -MTA -Command "Install-Module Microsoft.WinGet.Configuration -AllowPrerelease -Scope $PsInstallScope"
180+
pwsh.exe -MTA -Command "Install-Module Microsoft.WinGet.Configuration -Scope $PsInstallScope"
181181
Write-Host "Done Installing Microsoft.WinGet.Configuration"
182182
}
183183
else {

0 commit comments

Comments
 (0)