From 2220fbfc236e0bc98d4ceb79005ed1a4b6eced0b Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 15 Jun 2019 13:30:22 +0200 Subject: [PATCH] Fix if-blocks --- DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index 6959bf884..f47e768b9 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -378,18 +378,22 @@ function Set-TargetResource $installADDSParams['DnsDelegationCredential'] = $DnsDelegationCredential $installADDSParams['CreateDnsDelegation'] = $true } + if ($PSBoundParameters.ContainsKey('DatabasePath')) { $installADDSParams['DatabasePath'] = $DatabasePath } + if ($PSBoundParameters.ContainsKey('LogPath')) { $installADDSParams['LogPath'] = $LogPath } + if ($PSBoundParameters.ContainsKey('SysvolPath')) { $installADDSParams['SysvolPath'] = $SysvolPath } + if ($PSBoundParameters.ContainsKey('DomainMode')) { $installADDSParams['DomainMode'] = $DomainMode @@ -402,6 +406,7 @@ function Set-TargetResource $installADDSParams['NewDomainName'] = $DomainName $installADDSParams['ParentDomainName'] = $ParentDomainName $installADDSParams['DomainType'] = 'ChildDomain' + if ($PSBoundParameters.ContainsKey('DomainNetBIOSName')) { $installADDSParams['NewDomainNetbiosName'] = $DomainNetBIOSName @@ -415,10 +420,12 @@ function Set-TargetResource { Write-Verbose -Message ($script:localizedData.CreatingForest -f $DomainName) $installADDSParams['DomainName'] = $DomainName + if ($PSBoundParameters.ContainsKey('DomainNetbiosName')) { $installADDSParams['DomainNetbiosName'] = $DomainNetBIOSName } + if ($PSBoundParameters.ContainsKey('ForestMode')) { $installADDSParams['ForestMode'] = $ForestMode