Install features using chocolatey

This commit is contained in:
Manuel Thalmann 2024-08-08 05:20:58 +02:00
parent 8812500285
commit aadc6413ad
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,7 @@ Start-SoftwareInstaller @PSBoundParameters `
foreach ($feature in @("DirectPlay", "NetFx3")) { foreach ($feature in @("DirectPlay", "NetFx3")) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") { if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature…"; Write-Information "Enabling the ``$feature`` feature…";
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName $feature; choco install --source windowsFeatures -y $feature;
} }
Install-WingetPackage Nadeo.TrackManiaNationsForever; Install-WingetPackage Nadeo.TrackManiaNationsForever;

View file

@ -14,7 +14,7 @@ Start-SoftwareInstaller @PSBoundParameters `
foreach ($feature in @("DirectPlay", "NetFx3")) { foreach ($feature in @("DirectPlay", "NetFx3")) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") { if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature…"; Write-Information "Enabling the ``$feature`` feature…";
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName $feature; choco install --source windowsFeatures -y $feature;
} }
} }