mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-27 14:59:16 +08:00
[CmdNotFound] Update InstallWinGetClientModule script to update to latest version of WinGet.Client module if not at minimum version
This commit is contained in:
parent
034308b976
commit
464c309976
@ -1,8 +1,12 @@
|
||||
if (Get-Module -ListAvailable -Name Microsoft.WinGet.Client)
|
||||
{
|
||||
Write-Host "WinGet Client module detected."
|
||||
# This message will be compared against in Command Not Found Settings page code behind. Take care when changing it.
|
||||
}
|
||||
$wingetModule = Get-Module -ListAvailable -Name Microsoft.WinGet.Client
|
||||
if ($wingetModule) {
|
||||
if ($wingetModule.Version -ge "1.8.1133") {
|
||||
Write-Host "WinGet Client module detected."
|
||||
# This message will be compared against in Command Not Found Settings page code behind. Take care when changing it.
|
||||
} else {
|
||||
Upgrade-Module -Name Microsoft.WinGet.Client
|
||||
}
|
||||
}
|
||||
else {
|
||||
Install-Module -Name Microsoft.WinGet.Client
|
||||
if (Get-Module -ListAvailable -Name Microsoft.WinGet.Client)
|
||||
|
Loading…
Reference in New Issue
Block a user