Examples/Sample_xWindowsOptionalFeatureSet_Enable.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<#
    .SYNOPSIS
        Enables the Windows optional features MicrosoftWindowsPowerShellV2 and
        Internet-Explorer-Optional-amd64 and outputs a log of the operations to a file at the path
        'C:\LogPath\Log.txt'.
#>

Configuration xWindowsOptionalFeatureSet_Enable
{
    Import-DscResource -ModuleName 'xPSDesiredStateConfiguration'

    xWindowsOptionalFeatureSet WindowsOptionalFeatureSet1
    {
        Name = @('MicrosoftWindowsPowerShellV2', 'Internet-Explorer-Optional-amd64')
        Ensure = 'Present'
        LogPath = 'C:\LogPath\Log.txt'
    }
}