1 Import-Module "$PSScriptRoot\..\CompositeResourceHelper.psm1"
3 Configuration WindowsOptionalFeatureSet
7 [Parameter(Mandatory=$true)]
8 [ValidateNotNullOrEmpty()]
12 [Parameter(Mandatory=$true)]
13 [ValidateSet('Enable','Disable')]
17 [ValidateNotNullOrEmpty()]
22 $RemoveFilesOnDisable,
24 [ValidateNotNullOrEmpty()]
29 $NoWindowsUpdateCheck,
31 [ValidateSet('ErrorsOnly','ErrorsAndWarning','ErrorsAndWarningAndInformation')]
36 $psboundParams = $PSBoundParameters
37 $optionalParameters = @("Ensure","Source","RemoveFilesOnDisable","LogPath","NoWindowsUpdateCheck","LogLevel")
38 $keyParamName = "Name"
39 $resourceName = "WindowsOptionalFeature"
41 #build common parameters for all WindowsOptionalFeature resource nodes
42 [string] $commonParameters = BuildResourceCommonParameters -KeyParamName $keyParamName -OptionalParams $optionalParameters -PSBoundParams $psboundParams
44 #build WindowsOptionalFeature resource string
45 [string] $resourceString = BuildResourceString -KeyParam $Name -KeyParamName $keyParamName -CommonParams $commonParameters -ResourceName $resourceName
47 $configScript = [scriptblock]::Create($resourceString)