Enure features for PinnedItem are installed

This commit is contained in:
Manuel Thalmann 2024-08-08 05:21:21 +02:00
parent aadc6413ad
commit ffcda8584d

View file

@ -12,4 +12,20 @@ foreach ($key in $PSBoundParameters.Keys) {
$parameters.Add($key, $PSBoundParameters.TryGetValue($key));
}
Start-SoftwareInstaller @parameters;
$arguments = $parameters.arguments;
$arguments.Add("Installer", $parameters.installer);
Start-SoftwareInstaller @parameters -Installer {
param(
[hashtable] $Arguments
)
$feature = "NetFx3";
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Host "Enabling ``$feature`` feature…";
choco install --source windowsFeatures -y $feature;
}
& $Arguments.Installer;
}