Compare commits

...

2 Commits

Author SHA1 Message Date
cdeb1d45f2 Merge branch 'main' of https://github.com/Marterich/winutil 2024-03-07 21:30:16 +01:00
9eec615eff Document Formatting 2024-03-07 21:29:36 +01:00

View File

@ -19,11 +19,11 @@ function Test-WinUtilPackageManager {
# Install Winget if not detected
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
if ($wingetExists) {
if ($wingetExists) {
$wingetversionfull = (winget --version)
$wingetversiontrim = $wingetversionfull.Trim('v')
if ($wingetversiontrim.EndsWith("-preview")){
$wingetversiontrim = $wingetversiontrim.Trim('-preview')
if ($wingetversiontrim.EndsWith("-preview")) {
$wingetversiontrim = $wingetversiontrim.Trim('-preview')
$wingetpreview = $true
}
$wingetVersion = [System.Version]::Parse($wingetversiontrim)
@ -43,17 +43,17 @@ function Test-WinUtilPackageManager {
if ($winget) {
if ($wingetExists -and !$wingetOutdated) {
if (!$wingetpreview){
if (!$wingetpreview) {
Write-Host "- Winget up-to-date"
} else{
} else {
Write-Host "- Winget preview version detected. Unexptected problems may occur" -ForegroundColor Yellow
}
return $true
}
}
if($choco){
if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
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
}