Created
December 18, 2015 20:00
-
-
Save guitarrapc/ca95659b3b51faf8751e to your computer and use it in GitHub Desktop.
New Resource in WMFv5 RTM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module "$PSScriptRoot\..\CompositeResourceHelper.psm1" | |
Configuration WindowsOptionalFeatureSet | |
{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[System.String[]] | |
$Name, | |
[Parameter(Mandatory=$true)] | |
[ValidateSet('Enable','Disable')] | |
[System.String] | |
$Ensure, | |
[ValidateNotNullOrEmpty()] | |
[System.String[]] | |
$Source, | |
[System.Boolean] | |
$RemoveFilesOnDisable, | |
[ValidateNotNullOrEmpty()] | |
[System.String] | |
$LogPath, | |
[System.Boolean] | |
$NoWindowsUpdateCheck, | |
[ValidateSet('ErrorsOnly','ErrorsAndWarning','ErrorsAndWarningAndInformation')] | |
[System.String] | |
$LogLevel | |
) | |
$psboundParams = $PSBoundParameters | |
$optionalParameters = @("Ensure","Source","RemoveFilesOnDisable","LogPath","NoWindowsUpdateCheck","LogLevel") | |
$keyParamName = "Name" | |
$resourceName = "WindowsOptionalFeature" | |
#build common parameters for all WindowsOptionalFeature resource nodes | |
[string] $commonParameters = BuildResourceCommonParameters -KeyParamName $keyParamName -OptionalParams $optionalParameters -PSBoundParams $psboundParams | |
#build WindowsOptionalFeature 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