PortValhalla/scripts/Windows/Software/PinnedItem/Manage.ps1

32 lines
843 B
PowerShell

param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Software/PowerShell/Module.ps1";
$parameters = Get-ModuleInstallerComponents "PinnedItem" -NativeOnly -NoProfile;
foreach ($key in $PSBoundParameters.Keys) {
$parameters.Add($key, $PSBoundParameters.TryGetValue($key));
}
$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 @PSBoundParameters;
}