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