Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WMFv5 RTM additional Resource
Import-Module "$PSScriptRoot\..\CompositeResourceHelper.psm1"
Configuration WindowsFeatureSet
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$Name,
[ValidateSet('Present','Absent')]
[System.String]
$Ensure,
[ValidateNotNullOrEmpty()]
[System.String]
$Source,
[System.Boolean]
$IncludeAllSubFeature,
[ValidateNotNull()]
[System.Management.Automation.PSCredential]
$Credential,
[ValidateNotNullOrEmpty()]
[System.String]
$LogPath
)
$psboundParams = $PSBoundParameters
$optionalParameters = @("Ensure","Source","IncludeAllSubFeature","Credential","LogPath")
$keyParamName = "Name"
$resourceName = "WindowsFeature"
#build common parameters for all WindowsFeature resource nodes
[string] $commonParameters = BuildResourceCommonParameters -KeyParamName $keyParamName -OptionalParams $optionalParameters -PSBoundParams $psboundParams
#build WindowsFeature resource string
[string] $resourceString = BuildResourceString -KeyParam $Name -KeyParamName $keyParamName -CommonParams $commonParameters -ResourceName $resourceName
$configScript = [scriptblock]::Create($resourceString)
. $configScript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment