From 7223fbc77f095474db27c2788c7c0193ef1ddd10 Mon Sep 17 00:00:00 2001 From: Iain Brighton Date: Wed, 17 Feb 2016 14:14:01 +0000 Subject: [PATCH] Removes -ExcludeDns parameter --- .../MSFT_xADDomain/MSFT_xADDomain.psm1 | 16 ++------- .../MSFT_xADDomain/MSFT_xADDomain.schema.mof | 1 - Tests/Unit/MSFT_xADDomain.Tests.ps1 | 33 ------------------- 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index 4ad0ac09a..96f62f01c 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -52,10 +52,7 @@ function Get-TargetResource [String] $LogPath, [Parameter()] [ValidateNotNullOrEmpty()] - [String] $SysvolPath, - - [Parameter()] - [System.Boolean] $ExcludeDns + [String] $SysvolPath ) Assert-Module -ModuleName 'ADDSDeployment'; @@ -140,10 +137,7 @@ function Test-TargetResource [String] $LogPath, [Parameter()] [ValidateNotNullOrEmpty()] - [String] $SysvolPath, - - [Parameter()] - [System.Boolean] $ExcludeDns + [String] $SysvolPath ) $targetResource = Get-TargetResource @PSBoundParameters @@ -216,10 +210,7 @@ function Set-TargetResource [String] $LogPath, [Parameter()] [ValidateNotNullOrEmpty()] - [String] $SysvolPath, - - [Parameter()] - [System.Boolean] $ExcludeDns + [String] $SysvolPath ) # Debug can pause Install-ADDSForest/Install-ADDSDomain, so we remove it. @@ -229,7 +220,6 @@ function Set-TargetResource $installADDSParams = @{ SafeModeAdministratorPassword = $SafemodeAdministratorPassword.Password; - InstallDns = -not $ExcludeDns; NoRebootOnCompletion = $true; Force = $true; } diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.schema.mof b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.schema.mof index 6d6028118..47c01842d 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.schema.mof +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.schema.mof @@ -10,5 +10,4 @@ class MSFT_xADDomain : OMI_BaseResource [Write, Description("Path to a directory that contains the domain database")] String DatabasePath; [Write, Description("Path to a directory for the log file that will be written")] String LogPath; [Write, Description("Path to a directory where the Sysvol file will be written")] String SysvolPath; - [Write, Description("Specifies the DNS Server service should be not installed")] Boolean ExcludeDns; }; diff --git a/Tests/Unit/MSFT_xADDomain.Tests.ps1 b/Tests/Unit/MSFT_xADDomain.Tests.ps1 index 45444a97b..e07eaa2f8 100644 --- a/Tests/Unit/MSFT_xADDomain.Tests.ps1 +++ b/Tests/Unit/MSFT_xADDomain.Tests.ps1 @@ -233,22 +233,6 @@ try Assert-MockCalled Install-ADDSForest -ParameterFilter { $DomainName -eq $testDomainName } -Scope It; } - It 'Calls "Install-ADDSForest" with "InstallDns" by default, when creating forest' { - Mock Install-ADDSForest -ParameterFilter { $InstallDns -eq $true } { } - - Set-TargetResource @newForestParams; - - Assert-MockCalled Install-ADDSForest -ParameterFilter { $InstallDns -eq $true } -Scope It; - } - - It 'Calls "Install-ADDSForest" with "InstallDns:$false" creating forest, when "ExcludeDns" is specified' { - Mock Install-ADDSForest -ParameterFilter { $InstallDns -eq $false } { } - - Set-TargetResource @newForestParams -ExcludeDns $true; - - Assert-MockCalled Install-ADDSForest -ParameterFilter { $InstallDns -eq $false } -Scope It; - } - It 'Calls "Install-ADDSForest" with "SafemodeAdministratorPassword" when creating forest' { Mock Install-ADDSForest -ParameterFilter { $SafemodeAdministratorPassword -eq $testSafemodePassword } { } @@ -334,23 +318,6 @@ try Assert-MockCalled Install-ADDSDomain -ParameterFilter { $DomainType -eq 'ChildDomain' } -Scope It; } - It 'Calls "Install-ADDSDomain" with "InstallDns" by default, when creating child domain' { - Mock Install-ADDSDomain -ParameterFilter { $InstallDns -eq $true } { } - - Set-TargetResource @newDomainParams; - - Assert-MockCalled Install-ADDSDomain -ParameterFilter { $InstallDns -eq $true } -Scope It; - } - - It 'Calls "Install-ADDSDomain" with "InstallDns:$false" creating child domain, when "ExcludeDns" is specified' { - Mock Install-ADDSDomain -ParameterFilter { $InstallDns -eq $false } { } - - Set-TargetResource @newDomainParams -ExcludeDns $true; - - Assert-MockCalled Install-ADDSDomain -ParameterFilter { $InstallDns -eq $false } -Scope It; - } - - It 'Calls "Install-ADDSDomain" with "SafemodeAdministratorPassword" when creating child domain' { Mock Install-ADDSDomain -ParameterFilter { $SafemodeAdministratorPassword -eq $testSafemodePassword } { }