Install winget only if necessary

This commit is contained in:
Manuel Thalmann 2024-03-11 17:08:53 +01:00
parent 319daa374b
commit 140071c493

View file

@ -32,7 +32,10 @@ function Invoke-WindowsInstallation([Context] $context)
if (-not $context.Get("SoftwarePrerequisitesInstalled")) {
Write-Host "Installing prerequisites for installing software";
choco install -y winget;
if (-not $(Get-Command winget)) {
choco install -y winget;
}
Install-Module -AcceptLicense -Force "NuGet";
Import-Module NuGet;