Files
winutil/functions/private/Install-WinUtilWinget.ps1
T

22 lines
564 B
PowerShell
Raw Normal View History

+3
2023-03-07 12:28:00 -08:00
function Install-WinUtilWinget {
<#
2023-10-19 17:12:55 -05:00
.SYNOPSIS
Installs Winget if not already installed.
2023-10-19 17:12:55 -05:00
+12
2023-11-28 16:11:11 -06:00
.DESCRIPTION
installs winget if needed
+3
2023-03-07 12:28:00 -08:00
#>
if ((Test-WinUtilPackageManager -winget) -eq "installed") {
return
+3
2023-03-07 12:28:00 -08:00
}
Write-Host "Winget is not Installed. Installing." -ForegroundColor Red
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
2026-01-05 10:18:24 -06:00
Install-PackageProvider -Name NuGet -Force
Install-Module Microsoft.WinGet.Client -Force
Import-Module Microsoft.WinGet.Client
Repair-WinGetPackageManager
+8
2024-03-28 12:39:23 -07:00
}