May I know in the following PowerShell DSC, what is the difference if I remove the Ensure property (not ensure attribute)?
In another sense, any default if no value specified for Ensure property?
Node WebServer
{
WindowsFeature IIS {
Ensure = "Present",
Name = "Web–Server"
}
}
I'm not sure what you mean by Ensure property vs Ensure attribute, but the default value is Present
. You can see in the documentation for the DSC WindowsFeature Resource that Ensure
is not required; Name
is the only required property:
WindowsFeature [string] #ResourceName { Name = [string] [ Credential = [PSCredential] ] [ Ensure = [string] { Absent | Present } ] [ IncludeAllSubFeature = [bool] ] [ LogPath = [string] ] [ DependsOn = [string[]] ] [ Source = [string] ] }