mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-03 03:23:31 -05:00
Compare commits
11 Commits
Runspace-C
...
f5d73c8aef
Author | SHA1 | Date | |
---|---|---|---|
f5d73c8aef | |||
e9893462b4 | |||
866d72ff73 | |||
86b2aaa972 | |||
dd2e4fb337 | |||
31c6622926 | |||
e745d798b1 | |||
a29364984b | |||
07eeed310b | |||
8e00077e50 | |||
fc505872d2 |
@ -19,12 +19,18 @@ function Test-WinUtilPackageManager {
|
||||
|
||||
# Install Winget if not detected
|
||||
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
|
||||
if ($wingetExists) {
|
||||
$wingetVersion = [System.Version]::Parse((winget --version).Trim('v'))
|
||||
if ($wingetExists) {
|
||||
$wingetversionfull = (winget --version)
|
||||
$wingetversiontrim = $wingetversionfull.Trim('v')
|
||||
if ($wingetversiontrim.EndsWith("-preview")){
|
||||
$wingetversiontrim = $wingetversiontrim.Trim('-preview')
|
||||
$wingetpreview = $true
|
||||
}
|
||||
$wingetVersion = [System.Version]::Parse($wingetversiontrim)
|
||||
$minimumWingetVersion = [System.Version]::new(1,2,10691) # Win 11 23H2 comes with bad winget v1.2.10691
|
||||
$wingetOutdated = $wingetVersion -le $minimumWingetVersion
|
||||
|
||||
Write-Host "Winget v$wingetVersion"
|
||||
Write-Host "Winget $wingetVersionfull"
|
||||
}
|
||||
|
||||
if (!$wingetExists -or $wingetOutdated) {
|
||||
@ -37,7 +43,11 @@ function Test-WinUtilPackageManager {
|
||||
|
||||
if ($winget) {
|
||||
if ($wingetExists -and !$wingetOutdated) {
|
||||
Write-Host "- Winget up-to-date"
|
||||
if (!$wingetpreview){
|
||||
Write-Host "- Winget up-to-date"
|
||||
} else{
|
||||
Write-Host "- Winget preview version detected. Unexptected problems may occur" -ForegroundColor Yellow
|
||||
}
|
||||
return $true
|
||||
}
|
||||
}
|
||||
@ -50,4 +60,4 @@ function Test-WinUtilPackageManager {
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user