From 8c028ee27a20c3cf78451c6acc6bec50990f7baf Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 11 Mar 2024 10:46:09 +0100 Subject: [PATCH] Only install `winget` if necessary --- Autounattend.template.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Autounattend.template.xml b/Autounattend.template.xml index 3b540f7..515e027 100644 --- a/Autounattend.template.xml +++ b/Autounattend.template.xml @@ -224,7 +224,11 @@ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocola Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1; -choco install -y winget; +if (-not $(Get-Command winget)) +{ + choco install -y winget; +} + choco install -y git --params='/WindowsTerminalProfile /DefaultBranchName:main'; choco install -y powershell-core --install-arguments='"ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1"'; refreshenv;