mirror of
https://github.com/Baipyrus/dotfiles.git
synced 2024-12-26 11:21:46 +00:00
21 lines
757 B
PowerShell
21 lines
757 B
PowerShell
function InstallWinget
|
|
{
|
|
# Reference: https://learn.microsoft.com/en-us/windows/package-manager/winget/#install-winget-on-windows-sandbox
|
|
$progressPreference = 'silentlyContinue'
|
|
Write-Host "Installing WinGet PowerShell module from PSGallery..."
|
|
Install-PackageProvider -Name NuGet -Force | Out-Null
|
|
Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null
|
|
Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet..."
|
|
Repair-WinGetPackageManager
|
|
}
|
|
|
|
function WingetInstall
|
|
{
|
|
$install = Read-Host "Install WinGet now? [Y/n]"
|
|
if ($install.ToLower() -ne 'n')
|
|
{ InstallWinget
|
|
}
|
|
|
|
winget.exe install -s winget --accept-source-agreements (Get-Content ./util/winget.list)
|
|
}
|