DSCResources/DSC_WindowsCapability/en-US/about_WindowsCapability.help.txt
.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' } } } |