mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 09:04:47 -05:00
Test 2024 02 03 (#1583)
* Compile Winutil * winget fixes and checks * Compile Winutil * fix Parsec winget id (#1558) * Compile Winutil * fix winget issues * Compile Winutil * cleanup winget * Compile Winutil * Updated README.md (#1570) Fixed typos in readme file ("cusom" -> "custom", "twekas" -. "tweaks". Also added full stops. * Compile Winutil * Create close-old-issues.yml * Compile Winutil * update issues --------- Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: Saikrishnan K <53394202+K-Saikrishnan@users.noreply.github.com> Co-authored-by: Harry Perkin <68484588+HarryPerkin@users.noreply.github.com>
This commit is contained in:
@ -17,14 +17,34 @@ function Test-WinUtilPackageManager {
|
||||
[System.Management.Automation.SwitchParameter]$choco
|
||||
)
|
||||
|
||||
if($winget){
|
||||
if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
|
||||
# Install Winget if not detected
|
||||
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
|
||||
if ($wingetExists) {
|
||||
$wingetVersion = [System.Version]::Parse((winget --version).Trim('v'))
|
||||
$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"
|
||||
}
|
||||
|
||||
if (!$wingetExists -or $wingetOutdated) {
|
||||
if (!$wingetExists) {
|
||||
Write-Host "Winget not detected"
|
||||
} else {
|
||||
Write-Host "- Winget out-dated"
|
||||
}
|
||||
}
|
||||
|
||||
if ($winget) {
|
||||
if ($wingetExists -and !$wingetOutdated) {
|
||||
Write-Host "- Winget up-to-date"
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
if($choco){
|
||||
if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
|
||||
Write-Host "Chocolatey v$chocoVersion"
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user