DSCResources/DSC_WindowsCapability/en-US/about_WindowsCapability.help.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.NAME
    WindowsCapability
 
.DESCRIPTION
    This resource enables installation or removal of a Windows Capability.
 
    The LogLevel and LogPath parameters can be passed to the resource but
    are not used to determine if the resource is in the desired state.
 
    This is because the LogLevel and LogPath properties returned by
    `Get-WindowsCapability` do not reflect the values that may have been
    set with `Add-WindowsCapability` or `Remove-WindowsCapability`.
 
.PARAMETER Name
    Key - String
    Specifies the name of the Windows Capability.
 
.PARAMETER Ensure
    Write - String
    Allowed values: Present, Absent
    Specifies whether the Windows Capability should be installed or uninstalled. To install the Windows Capability, set this property to Present. To uninstall the Windows Capability, set the property to Absent.
 
.PARAMETER LogLevel
    Write - String
    Allowed values: Errors, Warnings, WarningsInfo
    Specifies the given Log Level of a Windows Capability. This is a write only parameter that is used when updating the status of a Windows Capability. If not specified, the default is 'WarningsInfo'.
 
.PARAMETER LogPath
    Write - String
    Specifies the full path and file name to log to. This is a write only parameter that is used when updating the status of a Windows Capability. If not specified, the default is '%WINDIR%\Logs\Dism\dism.log'.
 
.PARAMETER Source
    Write - String
    Specifies the location of the files that are required to add a Windows capability package to an image. You can specify the Windows directory of a mounted image or a running Windows installation that is shared on the network.
 
.EXAMPLE 1
 
Example script that adds the Windows Capability XPS.Viewer~~~~0.0.1.0
 
Configuration WindowsCapability_AddWindowsCapability_Config
{
    Import-DSCResource -ModuleName ComputerManagementDsc
 
    Node localhost
    {
        WindowsCapability XPSViewer
        {
            Name = 'XPS.Viewer~~~~0.0.1.0'
            Ensure = 'Present'
        }
    }
}
 
.EXAMPLE 2
 
Example script that removes the Windows Capability XPS.Viewer~~~~0.0.1.0
 
Configuration WindowsCapability_RemoveWindowsCapability_Config
{
    Import-DSCResource -ModuleName ComputerManagementDsc
 
    Node localhost
    {
        WindowsCapability XPSViewer
        {
            Name = 'XPS.Viewer~~~~0.0.1.0'
            Ensure = 'Absent'
        }
    }
}
 
.EXAMPLE 3
 
Example script that adds the Windows Capability OpenSSH.Client~~~~0.0.1.0
and set the LogLevel to log Errors only and write the Logfile to Path C:\Temp.
 
Configuration WindowsCapability_AddWindowsCapabilitywithLogLevelandLogPath_Config
{
    Import-DSCResource -ModuleName ComputerManagementDsc
 
    Node localhost
    {
        WindowsCapability OpenSSHClient
        {
            Name = 'OpenSSH.Client~~~~0.0.1.0'
            Ensure = 'Present'
            LogLevel = 'Errors'
            LogPath = 'C:\Temp\Logfile.log'
        }
    }
}
 
.EXAMPLE 4
 
Example script that adds the Windows Capability OpenSSH.Client~~~~0.0.1.0
and set the LogLevel to log Errors only and write the Logfile to Path C:\Temp.
This also uses the Source path for the installation.
 
Configuration WindowsCapability_AddWindowsCapabilitywithLogLevelLogPathandSource_Config
{
    Import-DSCResource -ModuleName ComputerManagementDsc
 
    Node localhost
    {
        WindowsCapability OpenSSHClient
        {
            Name = 'OpenSSH.Client~~~~0.0.1.0'
            Ensure = 'Present'
            LogLevel = 'Errors'
            LogPath = 'C:\Temp\Logfile.log'
            Source = 'F:\Source\FOD\LanguagesAndOptionalFeatures'
        }
    }
}