From 419c4a4137138d3a27c95f86bdb5608798c827f9 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Thu, 12 Sep 2019 13:50:42 +0100 Subject: [PATCH 01/16] Checking in to switch dev machines --- DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 | 2 ++ .../MSFT_ADReplicationSite/MSFT_ADReplicationSite.schema.mof | 1 + 2 files changed, 3 insertions(+) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index b90fde471..ede412e41 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -35,6 +35,7 @@ function Get-TargetResource $returnValue = @{ Ensure = 'Absent' Name = $Name + Description = '' RenameDefaultFirstSiteName = '' } } @@ -44,6 +45,7 @@ function Get-TargetResource $returnValue = @{ Ensure = 'Present' Name = $Name + Description = $replicationSite.Description RenameDefaultFirstSiteName = '' } } diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.schema.mof b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.schema.mof index 024c63c7f..2993c35bf 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.schema.mof +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.schema.mof @@ -4,4 +4,5 @@ class MSFT_ADReplicationSite : OMI_BaseResource [Write, Description("Specifies if the Active Directory replication site should be present or absent. Default value is 'Present'."), ValueMap{"Present", "Absent"}, Values{"Present", "Absent"}] String Ensure; [Key, Description("Specifies the name of the Active Directory replication site.")] String Name; [Write, Description("Specifies if the Default-First-Site-Name should be renamed if it exists. Default value is $false.")] Boolean RenameDefaultFirstSiteName; + [Write, Description("Specifies a description of the object. This parameter sets the value of the Description property for the object. The LDAP Display Name (ldapDisplayName) for this property is 'description'.")] String Description; }; From 8dc90e7b9c498a48ba82f9e0b64c9ec348460e3f Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 07:22:58 +0100 Subject: [PATCH 02/16] Add description attribute to test-resource with unit tests --- .../MSFT_ADReplicationSite.psm1 | 54 ++++++++++++++++--- Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 | 52 ++++++++++++++---- 2 files changed, 88 insertions(+), 18 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index ede412e41..2b44a251c 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -132,6 +132,11 @@ function Set-TargetResource .PARAMETER RenameDefaultFirstSiteName Specify if the Default-First-Site-Name should be renamed, if it exists. Dafult value is 'false'. + + .PARAMETER Description + Specifies a description of the object. This parameter sets the value of + the Description property for the object. The LDAP Display Name + (ldapDisplayName) for this property is 'description'. #> function Test-TargetResource { @@ -150,18 +155,53 @@ function Test-TargetResource [Parameter()] [System.Boolean] - $RenameDefaultFirstSiteName = $false + $RenameDefaultFirstSiteName = $false, + + [Parameter()] + [System.String] + $Description ) $currentConfiguration = Get-TargetResource -Name $Name + $configurationCompliant = $true - if ($currentConfiguration.Ensure -eq $Ensure) + if ($currentConfiguration.Ensure -eq 'Absent') { - Write-Verbose -Message ($script:localizedData.ReplicationSiteInDesiredState -f $Name) + # Site doesn't exist + if ($currentConfiguration.Ensure -eq $Ensure) + { + # Site should not exist + Write-Verbose -Message ($script:localizedData.ReplicationSiteInDesiredState -f $Name) + } + else + { + #Site should exist + Write-Verbose -Message ($script:localizedData.ReplicationSiteNotInDesiredState -f $Name) + $configurationCompliant = $false + } } - else - { - Write-Verbose -Message ($script:localizedData.ReplicationSiteNotInDesiredState -f $Name) + else { + # Site Exists + if ($currentConfiguration.Ensure -eq $Ensure) + { + # Site should exist + if ($currentConfiguration.Description -ne $Description) + { + Write-Verbose -Message ($script:localizedData.ReplicationSiteNotInDesiredState -f $Name) + $configurationCompliant = $false + } + else + { + Write-Verbose -Message ($script:localizedData.ReplicationSiteInDesiredState -f $Name) + } + } + else + { + # Site should not exist + Write-Verbose -Message ($script:localizedData.ReplicationSiteNotInDesiredState -f $Name) + $configurationCompliant = $false + } } - return $currentConfiguration.Ensure -eq $Ensure + + return $configurationCompliant } diff --git a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 index 005b3f4b4..b4dc839f0 100644 --- a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 +++ b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 @@ -46,12 +46,14 @@ try # Load stub cmdlets and classes. Import-Module (Join-Path -Path $PSScriptRoot -ChildPath 'Stubs\ActiveDirectory_2019.psm1') -Force - $presentSiteName = 'DemoSite' - $absentSiteName = 'MissingSite' + $presentSiteName = 'DemoSite' + $absentSiteName = 'MissingSite' + $genericDescription = "Demonstration Site Description" $presentSiteMock = [PSCustomObject] @{ Name = $presentSiteName DistinguishedName = "CN=$presentSiteName,CN=Sites,CN=Configuration,DC=contoso,DC=com" + Description = $genericDescription } $defaultFirstSiteNameSiteMock = [PSCustomObject] @{ @@ -60,32 +62,43 @@ try } $presentSiteTestPresent = @{ - Ensure = 'Present' - Name = $presentSiteName + Ensure = 'Present' + Name = $presentSiteName + Description = $genericDescription } $presentSiteTestAbsent = @{ Ensure = 'Absent' Name = $presentSiteName + Description = $genericDescription + } + + $presentSiteTestMismatchDescription = @{ + Ensure = 'Present' + Name = $presentSiteName + Description = 'Some random test description' } $absentSiteTestPresent = @{ Ensure = 'Present' Name = $absentSiteName + Description = $genericDescription } $absentSiteTestAbsent = @{ Ensure = 'Absent' Name = $absentSiteName + Description = $genericDescription } $presentSiteTestPresentRename = @{ Ensure = 'Present' Name = $presentSiteName + Description = $genericDescription RenameDefaultFirstSiteName = $true } #region Function Get-TargetResource - Describe 'ADReplicationSite\Get-TargetResource' { - It 'Should return a "System.Collections.Hashtable" object type' { + Describe 'When getting the Target Resource Information' { + It 'Should return a "System.Collections.Hashtable" object type with specified attributes' { # Arrange Mock -CommandName Get-ADReplicationSite -MockWith { $presentSiteMock } @@ -95,6 +108,9 @@ try # Assert $targetResource -is [System.Collections.Hashtable] | Should -BeTrue + $targetResource.Description | Should -BeOfType String + $targetResource.Name | Should -Not -BeNullOrEmpty + $targetResource.Ensure | Should -Not -BeNullOrEmpty } It 'Should return present if the site exists' { @@ -108,6 +124,7 @@ try # Assert $targetResource.Ensure | Should -Be 'Present' $targetResource.Name | Should -Be $presentSiteName + $targetResource.Description | Should -Be $genericDescription } It 'Should return absent if the site does not exist' { @@ -121,12 +138,13 @@ try # Assert $targetResource.Ensure | Should -Be 'Absent' $targetResource.Name | Should -Be $absentSiteName + $targetResource.Description | Should -BeNullOrEmpty } } #endregion #region Function Test-TargetResource - Describe 'ADReplicationSite\Test-TargetResource' { + Describe 'When testing the Target Resource configuration' { It 'Should return a "System.Boolean" object type' { # Arrange @@ -139,7 +157,7 @@ try $targetResourceState -is [System.Boolean] | Should -BeTrue } - It 'Should return true if the site should exists and does exists' { + It 'Should return true if the site should exist and does exist' { # Arrange Mock -CommandName Get-ADReplicationSite -MockWith { $presentSiteMock } @@ -151,7 +169,7 @@ try $targetResourceState | Should -BeTrue } - It 'Should return false if the site should exists but does not exists' { + It 'Should return false if the site should exist but does not exist' { # Arrange Mock -CommandName Get-ADReplicationSite @@ -163,7 +181,7 @@ try $targetResourceState | Should -BeFalse } - It 'Should return false if the site should not exists but does exists' { + It 'Should return false if the site should not exist but does exist' { # Arrange Mock -CommandName Get-ADReplicationSite -MockWith { $presentSiteMock } @@ -175,7 +193,7 @@ try $targetResourceState | Should -BeFalse } - It 'Should return true if the site should not exists and does not exists' { + It 'Should return true if the site should not exist and does not exist' { # Arrange Mock -CommandName Get-ADReplicationSite @@ -186,6 +204,18 @@ try # Assert $targetResourceState | Should -BeTrue } + + It 'Should return false if the site exists but the description is mismatched' { + + # Arrange + Mock -CommandName Get-ADReplicationSite + + # Act + $targetResourceState = Test-TargetResource @presentSiteTestMismatchDescription + + # Assert + $targetResourceState | Should -BeFalse + } } #endregion From e4b255d5b90148ae59f975b4121346d35aa3738c Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 09:27:11 +0100 Subject: [PATCH 03/16] Add Description to Set-TargetResource Unit tests also added --- .../MSFT_ADReplicationSite.psm1 | 35 +++++++++++++++++-- .../en-US/MSFT_ADReplicationSite.strings.psd1 | 1 + Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 | 10 ++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index 2b44a251c..ebd25ef6f 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -84,9 +84,17 @@ function Set-TargetResource [Parameter()] [System.Boolean] - $RenameDefaultFirstSiteName = $false + $RenameDefaultFirstSiteName = $false, + + [Parameter()] + [System.String] + $Description ) + $Params = @{} + $createOrUpdate = Get-ADReplicationSite -Identity $Name + + if ($Ensure -eq 'Present') { $defaultFirstSiteName = Get-ADReplicationSite -Filter { Name -eq 'Default-First-Site-Name' } @@ -101,12 +109,33 @@ function Set-TargetResource Write-Verbose -Message ($script:localizedData.AddReplicationSiteDefaultFirstSiteName -f $Name) Rename-ADObject -Identity $defaultFirstSiteName.DistinguishedName -NewName $Name -ErrorAction Stop + + if($Description) + { + Set-ADReplicationSite -Identity $Name -Description $Description + } } else { - Write-Verbose -Message ($script:localizedData.AddReplicationSite -f $Name) + if ($createOrUpdate) + { + # Update site + Write-Verbose -Message ($script:localizedData.UpdateReplicationSite -f $Name) + Set-ADReplicationSite -Identity $Name -Description $Description + } + else + { + Write-Verbose -Message ($script:localizedData.AddReplicationSite -f $Name) - New-ADReplicationSite -Name $Name -ErrorAction Stop + $Params.Add('Name', $Name) + $Params.Add('ErrorAction', 'Stop') + if($Description) + { + $Params.Add('Description', $Description) + } + + New-ADReplicationSite @Params + } } } diff --git a/DSCResources/MSFT_ADReplicationSite/en-US/MSFT_ADReplicationSite.strings.psd1 b/DSCResources/MSFT_ADReplicationSite/en-US/MSFT_ADReplicationSite.strings.psd1 index 533ed8515..7a30f4d3b 100644 --- a/DSCResources/MSFT_ADReplicationSite/en-US/MSFT_ADReplicationSite.strings.psd1 +++ b/DSCResources/MSFT_ADReplicationSite/en-US/MSFT_ADReplicationSite.strings.psd1 @@ -8,4 +8,5 @@ ConvertFrom-StringData @' ReplicationSitePresent = Replication site '{0}' is present. (ADRS0006) ReplicationSiteInDesiredState = The replication site '{0}' is in the desired state. (ADRS0007) ReplicationSiteNotInDesiredState = The replication site '{0}' is not in the desired state. (ADRS0008) + UpdateReplicationSite = The replication site '{0}' needs to be updated. '@ diff --git a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 index b4dc839f0..9df40e31e 100644 --- a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 +++ b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 @@ -241,6 +241,7 @@ try Mock -CommandName Get-ADReplicationSite -MockWith { $defaultFirstSiteNameSiteMock } Mock -CommandName 'Rename-ADObject' -Verifiable Mock -CommandName 'New-ADReplicationSite' -Verifiable + Mock -CommandName Set-ADReplicationSite -Verifiable # Act Set-TargetResource @presentSiteTestPresentRename @@ -265,6 +266,15 @@ try Assert-MockCalled -CommandName 'New-ADReplicationSite' -Times 1 -Scope It } + It 'Should update a site if the description does not match' { + Mock -CommandName Get-ADReplicationSite -MockWith { $presentSiteTestPresent } + Mock -CommandName Set-ADReplicationSite -Verifiable + + Set-TargetResource @presentSiteTestMismatchDescription + + Assert-MockCalled -CommandName Set-ADReplicationSite -Times 1 -Scope It + } + It 'Should remove an existing site' { # Arrange From dbb48d0e79545b17b0d7b99c55b57dcfbaa0b48b Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 09:49:23 +0100 Subject: [PATCH 04/16] Update test to increase codecov --- Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 index 9df40e31e..ca9aed79a 100644 --- a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 +++ b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 @@ -208,7 +208,7 @@ try It 'Should return false if the site exists but the description is mismatched' { # Arrange - Mock -CommandName Get-ADReplicationSite + Mock -CommandName Get-ADReplicationSite { $presentSiteTestPresent } # Act $targetResourceState = Test-TargetResource @presentSiteTestMismatchDescription From de1cbbad14594b7e7df26537a04743c49668169b Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 12:44:14 +0100 Subject: [PATCH 05/16] Added Integration Testing Tests for add, remove, rename default sites. Restores at the end back to default settings. --- .../MSFT_ADReplicationSite.psm1 | 6 +- ...FT_ADReplicationSite.Integration.Tests.ps1 | 190 ++++++++++++++++++ .../MSFT_ADReplicationSite.config.ps1 | 83 ++++++++ 3 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 create mode 100644 Tests/Integration/MSFT_ADReplicationSite.config.ps1 diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index ebd25ef6f..b9ca23264 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -27,7 +27,7 @@ function Get-TargetResource # Get the replication site filtered by it's name. If the site is not # present, the command will return $null. Write-Verbose -Message ($script:localizedData.GetReplicationSite -f $Name) - $replicationSite = Get-ADReplicationSite -Filter { Name -eq $Name } + $replicationSite = Get-ADReplicationSite -Filter { Name -eq $Name } -ErrorAction SilentlyContinue if ($null -eq $replicationSite) { @@ -92,12 +92,12 @@ function Set-TargetResource ) $Params = @{} - $createOrUpdate = Get-ADReplicationSite -Identity $Name + $createOrUpdate = Get-ADReplicationSite -Filter { Name -eq $Name } -ErrorAction SilentlyContinue if ($Ensure -eq 'Present') { - $defaultFirstSiteName = Get-ADReplicationSite -Filter { Name -eq 'Default-First-Site-Name' } + $defaultFirstSiteName = Get-ADReplicationSite -Filter { Name -eq 'Default-First-Site-Name' } -ErrorAction SilentlyContinue <# Check if the user specified to rename the Default-First-Site-Name diff --git a/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 b/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 new file mode 100644 index 000000000..85af15bd9 --- /dev/null +++ b/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 @@ -0,0 +1,190 @@ +if ($env:APPVEYOR -eq $true) +{ + Write-Warning -Message 'Integration test is not supported in AppVeyor.' + return +} + +$script:dscModuleName = 'ActiveDirectoryDsc' +$script:dscResourceFriendlyName = 'ADReplicationSite' +$script:dscResourceName = "MSFT_$($script:dscResourceFriendlyName)" + +#region HEADER +# Integration Test Template Version: 1.3.3 +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) +if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` + (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) +{ + & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath 'DscResource.Tests')) +} + +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'DSCResource.Tests' -ChildPath 'TestHelper.psm1')) -Force +$TestEnvironment = Initialize-TestEnvironment ` + -DSCModuleName $script:dscModuleName ` + -DSCResourceName $script:dscResourceName ` + -TestType Integration +#endregion + +try +{ + $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" + . $configFile + + Describe "$($script:dscResourceName)_Integration" { + BeforeAll { + $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" + } + + $configurationName = "$($script:dscResourceName)_CreateSite_Config" + + Context ('When using configuration {0}' -f $configurationName) { + It 'Should compile and apply the MOF without throwing' { + { + $configurationParameters = @{ + OutputPath = $TestDrive + # The variable $ConfigurationData was dot-sourced above. + ConfigurationData = $ConfigurationData + } + + & $configurationName @configurationParameters + + $startDscConfigurationParameters = @{ + Path = $TestDrive + ComputerName = 'localhost' + Wait = $true + Verbose = $true + Force = $true + ErrorAction = 'Stop' + } + + Start-DscConfiguration @startDscConfigurationParameters + } | Should -Not -Throw + } + + It 'Should be able to call Get-DscConfiguration without throwing' { + { + $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop + } | Should -Not -Throw + } + + It 'Should have set the resource and all the parameters should match' { + $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript { + $_.ConfigurationName -eq $configurationName ` + -and $_.ResourceId -eq $resourceId + } + + $resourceCurrentState.Name | Should -Be 'NewADSite' + $resourceCurrentState.Description | Should -Be 'New AD site description' + } + + It 'Should return $true when Test-DscConfiguration is run' { + Test-DscConfiguration -Verbose | Should -Be 'True' + } + } + + $configurationName = "$($script:dscResourceName)_RemoveSite_Config" + + Context ('When using configuration {0}' -f $configurationName) { + It 'Should compile and apply the MOF without throwing' { + { + $configurationParameters = @{ + OutputPath = $TestDrive + # The variable $ConfigurationData was dot-sourced above. + ConfigurationData = $ConfigurationData + } + + & $configurationName @configurationParameters + + $startDscConfigurationParameters = @{ + Path = $TestDrive + ComputerName = 'localhost' + Wait = $true + Verbose = $true + Force = $true + ErrorAction = 'Stop' + } + + Start-DscConfiguration @startDscConfigurationParameters + } | Should -Not -Throw + } + + It 'Should be able to call Get-DscConfiguration without throwing' { + { + $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop + } | Should -Not -Throw + } + + It 'Should have set the resource and all the parameters should match' { + $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript { + $_.ConfigurationName -eq $configurationName ` + -and $_.ResourceId -eq $resourceId + } + + $resourceCurrentState.IsSingleInstance | Should -BeNullOrEmpty + } + + It 'Should return $true when Test-DscConfiguration is run' { + Test-DscConfiguration -Verbose | Should -Be 'True' + } + } + + $configurationName = "$($script:dscResourceName)_RenameDefaultSite_Config" + + Context ('When using configuration {0}' -f $configurationName) { + It 'Should compile and apply the MOF without throwing' { + { + $configurationParameters = @{ + OutputPath = $TestDrive + # The variable $ConfigurationData was dot-sourced above. + ConfigurationData = $ConfigurationData + } + + & $configurationName @configurationParameters + + $startDscConfigurationParameters = @{ + Path = $TestDrive + ComputerName = 'localhost' + Wait = $true + Verbose = $true + Force = $true + ErrorAction = 'Stop' + } + + Start-DscConfiguration @startDscConfigurationParameters + } | Should -Not -Throw + } + + It 'Should be able to call Get-DscConfiguration without throwing' { + { + $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop + } | Should -Not -Throw + } + + It 'Should have set the resource and all the parameters should match' { + $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript { + $_.ConfigurationName -eq $configurationName ` + -and $_.ResourceId -eq $resourceId + } + + $resourceCurrentState.Name | Should -Be 'RenamedDefaultADSite' + $resourceCurrentState.Description | Should -Be 'Renaming Default Site' + } + + It 'Should return $true when Test-DscConfiguration is run' { + Test-DscConfiguration -Verbose | Should -Be 'True' + } + } + + } +} +finally +{ + #region FOOTER + + # Rename Site back to Default + $RenamedSite = Get-ADReplicationSite -Filter { Name -eq 'RenamedDefaultADSite' } + Set-ADReplicationSite $RenamedSite -Description $null + Rename-ADObject -Identity $RenamedSite.DistinguishedName -NewName 'Default-First-Site-Name' -ErrorAction Stop + + Restore-TestEnvironment -TestEnvironment $TestEnvironment + #endregion +} diff --git a/Tests/Integration/MSFT_ADReplicationSite.config.ps1 b/Tests/Integration/MSFT_ADReplicationSite.config.ps1 new file mode 100644 index 000000000..6b6d01eaa --- /dev/null +++ b/Tests/Integration/MSFT_ADReplicationSite.config.ps1 @@ -0,0 +1,83 @@ +#region HEADER +# Integration Test Config Template Version: 1.2.0 +#endregion + +$configFile = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'json') +if (Test-Path -Path $configFile) +{ + <# + Allows reading the configuration data from a JSON file, for real testing + scenarios outside of the CI. + #> + $ConfigurationData = Get-Content -Path $configFile | ConvertFrom-Json +} +else +{ + $ConfigurationData = @{ + AllNodes = @( + @{ + NodeName = 'localhost' + CertificateFile = $env:DscPublicCertificatePath + } + ) + } +} + +<# + .SYNOPSIS + Creates a brand new Site in AD Sites and Services. +#> +Configuration MSFT_ADReplicationSite_CreateSite_Config +{ + Import-DscResource -ModuleName 'ActiveDirectoryDsc' + + node $AllNodes.NodeName + { + ADReplicationSite 'Integration_Test' + { + Name = 'NewADSite' + Description = 'New AD site description' + Ensure = 'Present' + } + } +} + +<# + .SYNOPSIS + Remove site from AD Sites and Services +#> +Configuration MSFT_ADReplicationSite_RemoveSite_Config +{ + Import-DscResource -ModuleName 'ActiveDirectoryDsc' + + node $AllNodes.NodeName + { + ADReplicationSite 'Integration_Test' + { + Name = 'NewADSite' + Description = 'New AD site description' + Ensure = 'Absent' + } + } +} + +<# + .SYNOPSIS + Rename the Default Site in Active Directory +#> +Configuration MSFT_ADReplicationSite_RenameDefaultSite_Config +{ + Import-DscResource -ModuleName 'ActiveDirectoryDsc' + + node $AllNodes.NodeName + { + ADReplicationSite 'Integration_Test' + { + Name = 'RenamedDefaultADSite' + Description = 'Renaming Default Site' + Ensure = 'Present' + RenameDefaultFirstSiteName = $true + } + } +} + From f1fd66dc56ccc7c20fe528f81eee31f205a3fee7 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 13:16:39 +0100 Subject: [PATCH 06/16] Update Help Text and a small tidy up --- .../en-US/about_ADReplicationSite.help.txt | 22 +++++++++++++++++++ ...FT_ADReplicationSite.Integration.Tests.ps1 | 4 ---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/en-US/about_ADReplicationSite.help.txt b/DSCResources/MSFT_ADReplicationSite/en-US/about_ADReplicationSite.help.txt index bfe0abf62..5239711ba 100644 --- a/DSCResources/MSFT_ADReplicationSite/en-US/about_ADReplicationSite.help.txt +++ b/DSCResources/MSFT_ADReplicationSite/en-US/about_ADReplicationSite.help.txt @@ -21,6 +21,10 @@ Write - Boolean Specifies if the Default-First-Site-Name should be renamed if it exists. Default value is $false. +.PARAMETER Description + Write - String + Specifies a description of the object. This parameter sets the value of the Description property for the object. The LDAP Display Name (ldapDisplayName) for this property is 'description'. + .EXAMPLE 1 This configuration will create an Active Directory replication site @@ -80,4 +84,22 @@ Configuration ADReplicationSite_RemoveADReplicationSite_Config } } +.EXAMPLE 4 + +This configuration will set the AD Relication Site description for +a site called SeattleSite + +Configuration ADReplicationSite_CreateADReplicationSite_Config +{ + Import-DscResource -Module ActiveDirectoryDsc + Node localhost + { + ADReplicationSite 'SeattleSite' + { + Ensure = 'Present' + Name = 'Seattle' + Description = 'Seattle Head Office' + } + } +} diff --git a/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 b/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 index 85af15bd9..cf4d2a178 100644 --- a/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 @@ -30,9 +30,6 @@ try . $configFile Describe "$($script:dscResourceName)_Integration" { - BeforeAll { - $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" - } $configurationName = "$($script:dscResourceName)_CreateSite_Config" @@ -173,7 +170,6 @@ try Test-DscConfiguration -Verbose | Should -Be 'True' } } - } } finally From 55b0c3def19b2be5aa91f36c6a3cc4e8759ee612 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 13:22:26 +0100 Subject: [PATCH 07/16] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71bb69c4f..8f4b30e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,9 @@ needs the feature Recycle Bin enabled ([issue #498](https://github.com/PowerShell/xActiveDirectory/issues/498)). - Updated integration test to be able to catch when a computer account cannot be restored. +- Changes to ADReplicationSite + - Added 'Description' attribute parameter ([issue #500](https://github.com/PowerShell/ActiveDirectoryDsc/issues/500)). + - Added Integration testing ([issue #355](https://github.com/PowerShell/ActiveDirectoryDsc/issues/355)) ## 4.0.0.0 From ee8dbe998d4988c2ae9026bf94876f6ecaa44de2 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 13 Sep 2019 14:11:32 +0100 Subject: [PATCH 08/16] Update MSFT_ADReplicationSite.Tests.ps1 increase codecov score --- Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 index ca9aed79a..0294ad560 100644 --- a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 +++ b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 @@ -273,6 +273,7 @@ try Set-TargetResource @presentSiteTestMismatchDescription Assert-MockCalled -CommandName Set-ADReplicationSite -Times 1 -Scope It + Assert-MockCalled -CommandName Get-ADReplicationSite -Times 2 -Scope It -Exactly } It 'Should remove an existing site' { @@ -286,6 +287,7 @@ try # Assert Assert-MockCalled -CommandName 'Remove-ADReplicationSite' -Times 1 -Scope It + Assert-MockCalled -CommandName Get-ADReplicationSite -Times 1 -Scope It -Exactly } } #endregion From 07933f222c8f16447b33eb868ec04d0908278e62 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Mon, 16 Sep 2019 10:49:13 +0100 Subject: [PATCH 09/16] Updates based on review --- .../MSFT_ADReplicationSite.psm1 | 38 +++++++++---------- ...FT_ADReplicationSite.Integration.Tests.ps1 | 14 +++++-- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index b9ca23264..2c51e284f 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -35,7 +35,7 @@ function Get-TargetResource $returnValue = @{ Ensure = 'Absent' Name = $Name - Description = '' + Description = $null RenameDefaultFirstSiteName = '' } } @@ -91,9 +91,7 @@ function Set-TargetResource $Description ) - $Params = @{} - $createOrUpdate = Get-ADReplicationSite -Filter { Name -eq $Name } -ErrorAction SilentlyContinue - + $createOrUpdate = Get-TargetResource $Name if ($Ensure -eq 'Present') { @@ -109,34 +107,32 @@ function Set-TargetResource Write-Verbose -Message ($script:localizedData.AddReplicationSiteDefaultFirstSiteName -f $Name) Rename-ADObject -Identity $defaultFirstSiteName.DistinguishedName -NewName $Name -ErrorAction Stop - - if($Description) - { - Set-ADReplicationSite -Identity $Name -Description $Description - } } else { - if ($createOrUpdate) - { - # Update site - Write-Verbose -Message ($script:localizedData.UpdateReplicationSite -f $Name) - Set-ADReplicationSite -Identity $Name -Description $Description - } - else + if ($createOrUpdate.Ensure -eq 'Absent') { Write-Verbose -Message ($script:localizedData.AddReplicationSite -f $Name) - $Params.Add('Name', $Name) - $Params.Add('ErrorAction', 'Stop') - if($Description) + $newADReplicationSiteParameters = @{ + Name = $Name + ErrorAction = 'Stop' + } + + if($PSBoundParameters.ContainsKey('Description')) { - $Params.Add('Description', $Description) + $newADReplicationSiteParameters['Description'] = $Description } - New-ADReplicationSite @Params + New-ADReplicationSite @newADReplicationSiteParameters } } + + if($PSBoundParameters.ContainsKey('Description') -and ($createOrUpdate.Ensure -eq 'Present' -or $RenameDefaultFirstSiteName)) + { + Write-Verbose -Message ($script:localizedData.UpdateReplicationSite -f $Name) + Set-ADReplicationSite -Identity $Name -Description $Description + } } if ($Ensure -eq 'Absent') diff --git a/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 b/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 index cf4d2a178..da5674fed 100644 --- a/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_ADReplicationSite.Integration.Tests.ps1 @@ -31,6 +31,10 @@ try Describe "$($script:dscResourceName)_Integration" { + BeforeAll { + $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" + } + $configurationName = "$($script:dscResourceName)_CreateSite_Config" Context ('When using configuration {0}' -f $configurationName) { @@ -177,10 +181,12 @@ finally #region FOOTER # Rename Site back to Default - $RenamedSite = Get-ADReplicationSite -Filter { Name -eq 'RenamedDefaultADSite' } - Set-ADReplicationSite $RenamedSite -Description $null - Rename-ADObject -Identity $RenamedSite.DistinguishedName -NewName 'Default-First-Site-Name' -ErrorAction Stop - + $renamedSite = Get-ADReplicationSite -Filter { Name -eq 'RenamedDefaultADSite' } + if ($null -ne $renamedSite) + { + Set-ADReplicationSite -Identity $RenamedSite -Description $null + Rename-ADObject -Identity $RenamedSite.DistinguishedName -NewName 'Default-First-Site-Name' -ErrorAction Stop + } Restore-TestEnvironment -TestEnvironment $TestEnvironment #endregion } From 823a1c58e8aba3badf4238f2503ff3d7d62583f8 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Mon, 16 Sep 2019 11:05:59 +0100 Subject: [PATCH 10/16] Set RenameDefaultFirstSiteName to false by default --- .../MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index 2c51e284f..fa2680104 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -36,7 +36,7 @@ function Get-TargetResource Ensure = 'Absent' Name = $Name Description = $null - RenameDefaultFirstSiteName = '' + RenameDefaultFirstSiteName = $false } } else @@ -46,7 +46,7 @@ function Get-TargetResource Ensure = 'Present' Name = $Name Description = $replicationSite.Description - RenameDefaultFirstSiteName = '' + RenameDefaultFirstSiteName = $false } } From ff0629a0fa91436a0f54592f596e07dfac2ebcf1 Mon Sep 17 00:00:00 2001 From: Mark Lewis <1800Zeta@users.noreply.github.com> Date: Mon, 16 Sep 2019 16:21:57 +0100 Subject: [PATCH 11/16] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f4b30e93..479c82f10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,7 +98,8 @@ cannot be restored. - Changes to ADReplicationSite - Added 'Description' attribute parameter ([issue #500](https://github.com/PowerShell/ActiveDirectoryDsc/issues/500)). - - Added Integration testing ([issue #355](https://github.com/PowerShell/ActiveDirectoryDsc/issues/355)) + - Added Integration testing ([issue #355](https://github.com/PowerShell/ActiveDirectoryDsc/issues/355)). + - Correct value returned for RenameDefaultFirstSiteName ([issue #502](https://github.com/PowerShell/ActiveDirectoryDsc/issues/502)). ## 4.0.0.0 From bc5dd690f6fab63c941db511a52029240061bcc8 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Wed, 18 Sep 2019 11:36:23 +0100 Subject: [PATCH 12/16] Feedback request Pt2 Also had to tweak unit tests for updated logic --- .../MSFT_ADReplicationSite.psm1 | 57 ++++++++++--------- Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 | 14 ++++- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index fa2680104..34dfcc3d5 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -21,7 +21,11 @@ function Get-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Name + $Name, + + [Parameter()] + [System.Boolean] + $RenameDefaultFirstSiteName ) # Get the replication site filtered by it's name. If the site is not @@ -36,7 +40,7 @@ function Get-TargetResource Ensure = 'Absent' Name = $Name Description = $null - RenameDefaultFirstSiteName = $false + RenameDefaultFirstSiteName = $RenameDefaultFirstSiteName } } else @@ -46,7 +50,7 @@ function Get-TargetResource Ensure = 'Present' Name = $Name Description = $replicationSite.Description - RenameDefaultFirstSiteName = $false + RenameDefaultFirstSiteName = $RenameDefaultFirstSiteName } } @@ -91,26 +95,26 @@ function Set-TargetResource $Description ) - $createOrUpdate = Get-TargetResource $Name + $getTargetResourceResult = Get-TargetResource -Name $Name -RenameDefaultFirstSiteName $RenameDefaultFirstSiteName if ($Ensure -eq 'Present') { - $defaultFirstSiteName = Get-ADReplicationSite -Filter { Name -eq 'Default-First-Site-Name' } -ErrorAction SilentlyContinue - - <# - Check if the user specified to rename the Default-First-Site-Name - and if it still exists. If both is true, rename the replication site - instead of creating a new site. - #> - if ($RenameDefaultFirstSiteName -and ($null -ne $defaultFirstSiteName)) + if ($getTargetResourceResult.Ensure -eq 'Absent') { - Write-Verbose -Message ($script:localizedData.AddReplicationSiteDefaultFirstSiteName -f $Name) + $defaultFirstSiteName = Get-ADReplicationSite -Filter { Name -eq 'Default-First-Site-Name' } -ErrorAction SilentlyContinue + + <# + Check if the user specified to rename the Default-First-Site-Name + and if it still exists. If both is true, rename the replication site + instead of creating a new site. + #> + if ($RenameDefaultFirstSiteName -and ($null -ne $defaultFirstSiteName)) + { + Write-Verbose -Message ($script:localizedData.AddReplicationSiteDefaultFirstSiteName -f $Name) - Rename-ADObject -Identity $defaultFirstSiteName.DistinguishedName -NewName $Name -ErrorAction Stop - } - else - { - if ($createOrUpdate.Ensure -eq 'Absent') + Rename-ADObject -Identity $defaultFirstSiteName.DistinguishedName -NewName $Name -ErrorAction Stop + } + else { Write-Verbose -Message ($script:localizedData.AddReplicationSite -f $Name) @@ -119,7 +123,7 @@ function Set-TargetResource ErrorAction = 'Stop' } - if($PSBoundParameters.ContainsKey('Description')) + if ($PSBoundParameters.ContainsKey('Description')) { $newADReplicationSiteParameters['Description'] = $Description } @@ -128,7 +132,7 @@ function Set-TargetResource } } - if($PSBoundParameters.ContainsKey('Description') -and ($createOrUpdate.Ensure -eq 'Present' -or $RenameDefaultFirstSiteName)) + if ($PSBoundParameters.ContainsKey('Description') -and ($getTargetResourceResult.Description -ne $Description)) { Write-Verbose -Message ($script:localizedData.UpdateReplicationSite -f $Name) Set-ADReplicationSite -Identity $Name -Description $Description @@ -187,13 +191,13 @@ function Test-TargetResource $Description ) - $currentConfiguration = Get-TargetResource -Name $Name + $getTargetResourceResult = Get-TargetResource -Name $Name -RenameDefaultFirstSiteName $RenameDefaultFirstSiteName $configurationCompliant = $true - if ($currentConfiguration.Ensure -eq 'Absent') + if ($getTargetResourceResult.Ensure -eq 'Absent') { # Site doesn't exist - if ($currentConfiguration.Ensure -eq $Ensure) + if ($getTargetResourceResult.Ensure -eq $Ensure) { # Site should not exist Write-Verbose -Message ($script:localizedData.ReplicationSiteInDesiredState -f $Name) @@ -205,12 +209,13 @@ function Test-TargetResource $configurationCompliant = $false } } - else { + else + { # Site Exists - if ($currentConfiguration.Ensure -eq $Ensure) + if ($getTargetResourceResult.Ensure -eq $Ensure) { # Site should exist - if ($currentConfiguration.Description -ne $Description) + if ($getTargetResourceResult.Description -ne $Description) { Write-Verbose -Message ($script:localizedData.ReplicationSiteNotInDesiredState -f $Name) $configurationCompliant = $false diff --git a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 index 0294ad560..4d33b035e 100644 --- a/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 +++ b/Tests/Unit/MSFT_ADReplicationSite.Tests.ps1 @@ -61,6 +61,13 @@ try DistinguishedName = "CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=contoso,DC=com" } + $absentSiteDefaultRenameMock = @{ + Ensure = 'Absent' + Name = $presentSiteTestPresent + Description = $null + RenameDefaultFirstSiteName = $true + } + $presentSiteTestPresent = @{ Ensure = 'Present' Name = $presentSiteName @@ -92,7 +99,7 @@ try $presentSiteTestPresentRename = @{ Ensure = 'Present' Name = $presentSiteName - Description = $genericDescription + Description = $genericDescription RenameDefaultFirstSiteName = $true } @@ -227,6 +234,7 @@ try # Arrange Mock -CommandName Get-ADReplicationSite Mock -CommandName 'New-ADReplicationSite' -Verifiable + Mock -CommandName 'Set-ADReplicationSite' -Verifiable # Act Set-TargetResource @presentSiteTestPresent @@ -238,6 +246,7 @@ try It 'Should rename the Default-First-Site-Name if it exists' { # Arrange + Mock -CommandName Get-TargetResource -MockWith { $absentSiteDefaultRenameMock } Mock -CommandName Get-ADReplicationSite -MockWith { $defaultFirstSiteNameSiteMock } Mock -CommandName 'Rename-ADObject' -Verifiable Mock -CommandName 'New-ADReplicationSite' -Verifiable @@ -273,7 +282,7 @@ try Set-TargetResource @presentSiteTestMismatchDescription Assert-MockCalled -CommandName Set-ADReplicationSite -Times 1 -Scope It - Assert-MockCalled -CommandName Get-ADReplicationSite -Times 2 -Scope It -Exactly + Assert-MockCalled -CommandName Get-ADReplicationSite -Times 1 -Scope It -Exactly } It 'Should remove an existing site' { @@ -287,7 +296,6 @@ try # Assert Assert-MockCalled -CommandName 'Remove-ADReplicationSite' -Times 1 -Scope It - Assert-MockCalled -CommandName Get-ADReplicationSite -Times 1 -Scope It -Exactly } } #endregion From 83b8971e307fc5eab6a4af27a7c41c6cff5e6a0d Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Wed, 18 Sep 2019 12:05:32 +0100 Subject: [PATCH 13/16] Remove extra parentheses as requested --- .../MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 index 34dfcc3d5..d4531b55b 100644 --- a/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 +++ b/DSCResources/MSFT_ADReplicationSite/MSFT_ADReplicationSite.psm1 @@ -108,7 +108,7 @@ function Set-TargetResource and if it still exists. If both is true, rename the replication site instead of creating a new site. #> - if ($RenameDefaultFirstSiteName -and ($null -ne $defaultFirstSiteName)) + if ($RenameDefaultFirstSiteName -and $null -ne $defaultFirstSiteName) { Write-Verbose -Message ($script:localizedData.AddReplicationSiteDefaultFirstSiteName -f $Name) @@ -132,7 +132,7 @@ function Set-TargetResource } } - if ($PSBoundParameters.ContainsKey('Description') -and ($getTargetResourceResult.Description -ne $Description)) + if ($PSBoundParameters.ContainsKey('Description') -and $getTargetResourceResult.Description -ne $Description) { Write-Verbose -Message ($script:localizedData.UpdateReplicationSite -f $Name) Set-ADReplicationSite -Identity $Name -Description $Description From 0f38b6c3ef44533843085cab7203f5774ae7b2d6 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 20 Sep 2019 18:05:24 +0100 Subject: [PATCH 14/16] Update CHANGELOG.md Re-add to unreleased section --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54e593635..8ae94fe4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change log for ActiveDirectoryDsc ## Unreleased +- Changes to ADReplicationSite + - Added 'Description' attribute parameter ([issue #500](https://github.com/PowerShell/ActiveDirectoryDsc/issues/500)). + - Added Integration testing ([issue #355](https://github.com/PowerShell/ActiveDirectoryDsc/issues/355)). + - Correct value returned for RenameDefaultFirstSiteName ([issue #502](https://github.com/PowerShell/ActiveDirectoryDsc/issues/502)). ## 4.1.0.0 From 36acb708a83ccecd616a966920e91b6922114596 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 20 Sep 2019 18:18:40 +0100 Subject: [PATCH 15/16] Update CHANGELOG.md --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ae94fe4c..8e9b2e3f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,10 +102,6 @@ needs the feature Recycle Bin enabled ([issue #498](https://github.com/PowerShell/xActiveDirectory/issues/498)). - Updated integration test to be able to catch when a computer account cannot be restored. -- Changes to ADReplicationSite - - Added 'Description' attribute parameter ([issue #500](https://github.com/PowerShell/ActiveDirectoryDsc/issues/500)). - - Added Integration testing ([issue #355](https://github.com/PowerShell/ActiveDirectoryDsc/issues/355)). - - Correct value returned for RenameDefaultFirstSiteName ([issue #502](https://github.com/PowerShell/ActiveDirectoryDsc/issues/502)). ## 4.0.0.0 From 2823f32f9654077119000bad0610ff7668e149e8 Mon Sep 17 00:00:00 2001 From: Mark Lewis Date: Fri, 20 Sep 2019 18:36:09 +0100 Subject: [PATCH 16/16] Blank Line under Unreleased header --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9b2e3f1..9763e08e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change log for ActiveDirectoryDsc ## Unreleased + - Changes to ADReplicationSite - Added 'Description' attribute parameter ([issue #500](https://github.com/PowerShell/ActiveDirectoryDsc/issues/500)). - Added Integration testing ([issue #355](https://github.com/PowerShell/ActiveDirectoryDsc/issues/355)).