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