Hi
I’ve been experimenting with DSC to roll out Features on Windows Server. I’m using Windows Server 2012 r2
I have created a configuration which looks like this:
Configuration WebServerFeatures { Param ( $NodeName ) Node $NodeName { WindowsFeature WebServerIIS { Ensure = "Present" Name = "Web-Server" } } }
All of the sub features that I want to be installed are all listed in the configuration, so in reality the configuration is much longer than the example listed above.
I don’t want Directory Browsing to be installed, so I have set it to be Absent, eg:
WindowsFeature DirectoryBrowsing { Ensure = "Absent" Name = "Web-Dir-Browsing" }
I have saved the Configuration as WebServerFeaturesDSC.ps1 in the Modules folder. Then I run it with the following commands:
Set-Location C:\Windows\System32\WindowsPowerShell\v1.0\Modules . C:\Windows\System32\WindowsPowerShell\v1.0\Modules\WebServerFeaturesDSC.ps1 WebServerFeatures -nodename $($env:computername) Start-DscConfiguration .\WebServerFeatures -wait -Force
Everything works as expected, except the Directory Browsing feature that I want to be Absent gets installed. When I run Get-DSCConfiguration it lists the feature as present:
Credential : DisplayName : Directory Browsing Ensure : Present IncludeAllSubFeature : False LogPath : Name : Web-Dir-Browsing Source : PSComputerName :
Can anyone help with this?
Thanks