mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-03 03:23:31 -05:00
Compare commits
2 Commits
f5d73c8aef
...
cdeb1d45f2
Author | SHA1 | Date | |
---|---|---|---|
cdeb1d45f2 | |||
9eec615eff |
@ -19,11 +19,11 @@ function Test-WinUtilPackageManager {
|
|||||||
|
|
||||||
# Install Winget if not detected
|
# Install Winget if not detected
|
||||||
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
|
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
|
||||||
if ($wingetExists) {
|
if ($wingetExists) {
|
||||||
$wingetversionfull = (winget --version)
|
$wingetversionfull = (winget --version)
|
||||||
$wingetversiontrim = $wingetversionfull.Trim('v')
|
$wingetversiontrim = $wingetversionfull.Trim('v')
|
||||||
if ($wingetversiontrim.EndsWith("-preview")){
|
if ($wingetversiontrim.EndsWith("-preview")) {
|
||||||
$wingetversiontrim = $wingetversiontrim.Trim('-preview')
|
$wingetversiontrim = $wingetversiontrim.Trim('-preview')
|
||||||
$wingetpreview = $true
|
$wingetpreview = $true
|
||||||
}
|
}
|
||||||
$wingetVersion = [System.Version]::Parse($wingetversiontrim)
|
$wingetVersion = [System.Version]::Parse($wingetversiontrim)
|
||||||
@ -43,17 +43,17 @@ function Test-WinUtilPackageManager {
|
|||||||
|
|
||||||
if ($winget) {
|
if ($winget) {
|
||||||
if ($wingetExists -and !$wingetOutdated) {
|
if ($wingetExists -and !$wingetOutdated) {
|
||||||
if (!$wingetpreview){
|
if (!$wingetpreview) {
|
||||||
Write-Host "- Winget up-to-date"
|
Write-Host "- Winget up-to-date"
|
||||||
} else{
|
} else {
|
||||||
Write-Host "- Winget preview version detected. Unexptected problems may occur" -ForegroundColor Yellow
|
Write-Host "- Winget preview version detected. Unexptected problems may occur" -ForegroundColor Yellow
|
||||||
}
|
}
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($choco){
|
if ($choco) {
|
||||||
if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
|
if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)) {
|
||||||
Write-Host "Chocolatey v$chocoVersion"
|
Write-Host "Chocolatey v$chocoVersion"
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user