1 Import-Module "$PSScriptRoot\..\CompositeResourceHelper.psm1"
3 Configuration ServiceSet
5 [CmdletBinding(SupportsShouldProcess=$true)]
7 [Parameter(Mandatory=$true)]
8 [ValidateNotNullOrEmpty()]
12 [ValidateSet('Automatic','Manual','Disabled')]
16 [ValidateSet('LocalSystem','LocalService','NetworkService')]
20 [ValidateSet('Running','Stopped')]
24 [ValidateSet('Present','Absent')]
29 [System.Management.Automation.PSCredential]
33 $psboundParams = $PSBoundParameters
34 $optionalParameters = @("StartupType","BuiltInAccount","State","Ensure","Credential")
35 $keyParamName = "Name"
36 $resourceName = "Service"
38 #build common parameters for all Service resource nodes
39 [string] $commonParameters = BuildResourceCommonParameters -KeyParamName $keyParamName -OptionalParams $optionalParameters -PSBoundParams $psboundParams
41 #build Service resource string
42 [string] $resourceString = BuildResourceString -KeyParam $Name -KeyParamName $keyParamName -CommonParams $commonParameters -ResourceName $resourceName
44 $configScript = [scriptblock]::Create($resourceString)