Files
winutil/functions/private/Install-WinUtilWinget.ps1
Chris Titus Tech 63eeab0b19 fix whitespace
2026-01-05 10:18:24 -06:00

22 lines
564 B
PowerShell

function Install-WinUtilWinget {
<#
.SYNOPSIS
Installs Winget if not already installed.
.DESCRIPTION
installs winget if needed
#>
if ((Test-WinUtilPackageManager -winget) -eq "installed") {
return
}
Write-Host "Winget is not Installed. Installing." -ForegroundColor Red
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-PackageProvider -Name NuGet -Force
Install-Module Microsoft.WinGet.Client -Force
Import-Module Microsoft.WinGet.Client
Repair-WinGetPackageManager
}