Files
PowerShell-PSDscResources/Examples/Sample_WindowsFeature.ps1
T
2016-10-31 14:30:44 -07:00

46 lines
1.2 KiB
PowerShell

<#
Create a custom configuration by passing in whatever values you need.
$Name is the only parameter that is required which indicates which
Windows Feature you want to install (or uninstall if you set Ensure to Absent).
LogPath and Credential are not included here, but if you would like to specify
a custom log path or need a credential just pass in the desired values and add
LogPath = $LogPath and/or Credential = $Credential to the configuration here
#>
Configuration 'Install_Feature_Telnet_Client'
{
param
(
[System.String]
$Name = 'Telnet-Client',
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure = 'Present',
[System.Boolean]
$IncludeAllSubFeature = $false,
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[ValidateNotNullOrEmpty()]
[System.String]
$LogPath
)
Import-DscResource -ModuleName 'PSDscResources'
Node Localhost {
WindowsFeature WindowsFeatureTest
{
Name = $Name
Ensure = $Ensure
IncludeAllSubFeature = $IncludeAllSubFeature
}
}
}