]> insang Git - wevape-lu1_pos.git/blob
1e1ea9ac073f3629fd14ab04fff254867d5ec24c
[wevape-lu1_pos.git] /
1 Import-Module "$PSScriptRoot\..\CompositeResourceHelper.psm1"
2
3 Configuration WindowsOptionalFeatureSet
4 {
5     [CmdletBinding()]
6     param(
7     [Parameter(Mandatory=$true)]
8     [ValidateNotNullOrEmpty()]
9     [System.String[]]
10     $Name,
11
12     [Parameter(Mandatory=$true)]
13     [ValidateSet('Enable','Disable')]
14     [System.String]
15     $Ensure,
16
17     [ValidateNotNullOrEmpty()]
18     [System.String[]]
19     $Source,
20
21     [System.Boolean]
22     $RemoveFilesOnDisable,
23
24     [ValidateNotNullOrEmpty()]
25     [System.String]
26     $LogPath,
27
28     [System.Boolean]
29     $NoWindowsUpdateCheck,
30
31     [ValidateSet('ErrorsOnly','ErrorsAndWarning','ErrorsAndWarningAndInformation')]
32     [System.String]
33     $LogLevel
34     )
35     
36     $psboundParams = $PSBoundParameters
37     $optionalParameters = @("Ensure","Source","RemoveFilesOnDisable","LogPath","NoWindowsUpdateCheck","LogLevel")
38     $keyParamName = "Name"
39     $resourceName = "WindowsOptionalFeature"
40
41     #build common parameters for all WindowsOptionalFeature resource nodes
42     [string] $commonParameters = BuildResourceCommonParameters -KeyParamName $keyParamName -OptionalParams $optionalParameters -PSBoundParams $psboundParams
43     
44     #build WindowsOptionalFeature resource string
45     [string] $resourceString = BuildResourceString -KeyParam $Name -KeyParamName $keyParamName -CommonParams $commonParameters -ResourceName $resourceName
46
47     $configScript = [scriptblock]::Create($resourceString)
48     . $configScript
49 }