From cd06506e413bf4e8b944732c470cbb8d74438077 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 15 May 2016 10:58:08 +1200 Subject: [PATCH 01/13] Removed Pester version number from AppVeyor.yml --- README.md | 3 +++ appveyor.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7eff602..3d585c8 100644 --- a/README.md +++ b/README.md @@ -643,6 +643,9 @@ Start-DscConfiguration ` ``` ## Versions +### Unreleased +* Removed Pester version from AppVeyor.yml. + ### 3.0.0.0 * RepGroup renamed to ReplicationGroup in all files. * xDFSReplicationGroupConnection- Changed DisableConnection parameter to EnsureEnabled. diff --git a/appveyor.yml b/appveyor.yml index 5962b1a..50039bb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ os: WMF 5 version: 3.0.{build}.0 install: - - cinst -y pester --version 3.3.13 + - cinst -y pester - git clone https://github.com/PowerShell/DscResource.Tests - ps: Push-Location - cd DscResource.Tests From bae41233ca3c4fadba73c18e7ac8cde29c97860d Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 18:07:48 +1200 Subject: [PATCH 02/13] xDFSNamespaceServerConfiguration added. --- ...MSFT_xDFSNamespaceServerConfiguration.psm1 | 257 +++++++++++++++ ...DFSNamespaceServerConfiguration.schema.mof | 11 + ...e_xDFSNamespace_Domain_MultipleTarget.ps1} | 0 ...ple_xDFSNamespace_Domain_SingleTarget.ps1} | 0 ...s1 => Sample_xDFSNamespace_Standalone.ps1} | 14 +- .../Sample_xDFSNamespace_Standalone_FQDN.ps1 | 76 +++++ README.md | 120 ++++++- ...eServerConfiguration.Integration.Tests.ps1 | 88 +++++ ...DFSNamespaceServerConfiguration.config.ps1 | 23 ++ ...xDFSNamespaceServerConfiguration.Tests.ps1 | 307 ++++++++++++++++++ 10 files changed, 876 insertions(+), 20 deletions(-) create mode 100644 DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 create mode 100644 DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof rename Examples/{Sample_xDFSNamespaceRoot_Domain_MultipleTarget.ps1 => Sample_xDFSNamespace_Domain_MultipleTarget.ps1} (100%) rename Examples/{Sample_xDFSNamespaceRoot_Domain_SingleTarget.ps1 => Sample_xDFSNamespace_Domain_SingleTarget.ps1} (100%) rename Examples/{Sample_xDFSNamespaceRoot_Standalone.ps1 => Sample_xDFSNamespace_Standalone.ps1} (88%) create mode 100644 Examples/Sample_xDFSNamespace_Standalone_FQDN.ps1 create mode 100644 Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 create mode 100644 Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 create mode 100644 Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 new file mode 100644 index 0000000..b1e9021 --- /dev/null +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 @@ -0,0 +1,257 @@ +data LocalizedData +{ +# culture="en-US" +ConvertFrom-StringData -StringData @' +GettingNamespaceServerConfigurationMessage=Getting DFS Namespace Server Configuration. +SettingNamespaceServerConfigurationMessage=Setting DFS Namespace Server Configuration. +NamespaceServerConfigurationUpdateParameterMessage=Setting DFS Namespace Server Configuration parameter {0} to "{1}". +NamespaceServerConfigurationUpdatedMessage=Setting DFS Namespace Server Configuration updated. +NamespaceServerConfigurationServiceRestartedMessage=DFS Namespace Server restarted. +TestingNamespaceServerConfigurationMessage=Testing DFS Namespace Server Configuration. +NamespaceServerConfigurationParameterNeedsUpdateMessage=DFS Namespace Server Configuration parameter "{0}" is "{1}" but should be "{2}". Change required. +'@ +} + +<# + This is an array of all the parameters used by this resource + If the property Restart is true then when this property is updated the service + Will be restarted. +#> +data ParameterList +{ + @( + @{ Name = 'LdapTimeoutSec'; Type = 'Uint32' }, + @{ Name = 'EnableInsiteReferrals'; Type = 'Boolean' }, + @{ Name = 'EnableSiteCostedReferrals'; Type = 'Boolean' }, + @{ Name = 'PreferLogonDC'; Type = 'Boolean' }, + @{ Name = 'SyncIntervalSec'; Type = 'String' }, + @{ Name = 'UseFQDN'; Type = 'Uint32'; Restart = $True } + ) +} + +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([Hashtable])] + param + ( + [parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance + ) + + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.GettingNamespaceServerConfigurationMessage) + ) -join '' ) + + # The ComputerName will always be LocalHost unless a good reason can be provided to + # enable it as a parameter. + $ComputerName = 'LocalHost' + + # Get the current DFSN Server Configuration + $ServerConfiguration = Get-DfsnServerConfiguration ` + -ComputerName $ComputerName ` + -ErrorAction Stop + + # Generate the return object. + $ReturnValue = @{ + IsSingleInstance = 'Yes' + } + foreach ($parameter in $ParameterList) + { + $ReturnValue += @{ $parameter.Name = $ServerConfiguration.$($parameter.name) } + } # foreach + + return $ReturnValue +} # Get-TargetResource + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Uint32] + $LdapTimeoutSec, + + [Boolean] + $EnableInsiteReferrals, + + [Boolean] + $EnableSiteCostedReferrals, + + [Boolean] + $PreferLogonDC, + + [Uint32] + $SyncIntervalSec, + + [Boolean] + $UseFQDN + ) + + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.SettingNamespaceServerConfigurationMessage) + ) -join '' ) + + # The ComputerName will always be LocalHost unless a good reason can be provided to + # enable it as a parameter. + $ComputerName = 'LocalHost' + + # Get the current DFSN Server Configuration + $ServerConfiguration = Get-DfsnServerConfiguration ` + -ComputerName $ComputerName ` + -ErrorAction Stop + + # Generate a list of parameters that will need to be changed. + $ChangeParameters = @{} + $Restart = $False + foreach ($parameter in $ParameterList) + { + $ParameterSource = $ServerConfiguration.$($parameter.name) + $ParameterNew = (Invoke-Expression -Command "`$$($parameter.name)") + if ($PSBoundParameters.ContainsKey($parameter.Name) ` + -and ($ParameterSource -ne $ParameterNew)) { + { + $ChangeParameters += @{ + $($parameter.name) = $ParameterNew + } + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.NamespaceServerConfigurationUpdateParameterMessage) ` + -f $parameter.Name,$ParameterNew + ) -join '' ) + if ($parameter.Restart) + { + $Restart = $True + } # if + } # if + } # foreach + if ($ChangeParameters.Count -gt 0) + { + # Update any parameters that were identified as different + $null = Set-DfsnServerConfiguration ` + -ComputerName $ComputerName ` + @ChangeParameters ` + -ErrorAction Stop + + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.NamespaceServerConfigurationUpdatedMessage) + ) -join '' ) + + if ($Restart) + { + # Restart the DFS Service + $null = Restart-Service ` + -Name DFS ` + -Force ` + -ErrorAction Stop + + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.NamespaceServerConfigurationServiceRestartedMessage) + ) -join '' ) + } + } # if +} # Set-TargetResource + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Uint32] + $LdapTimeoutSec, + + [Boolean] + $EnableInsiteReferrals, + + [Boolean] + $EnableSiteCostedReferrals, + + [Boolean] + $PreferLogonDC, + + [Uint32] + $SyncIntervalSec, + + [Boolean] + $UseFQDN + ) + + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.TestingNamespaceServerConfigurationMessage) + ) -join '' ) + + # The ComputerName will always be LocalHost unless a good reason can be provided to + # enable it as a parameter. + $ComputerName = 'LocalHost' + + # Flag to signal whether settings are correct + [Boolean] $DesiredConfigurationMatch = $true + + # Get the current DFSN Server Configuration + $ServerConfiguration = Get-DfsnServerConfiguration ` + -ComputerName $ComputerName ` + -ErrorAction Stop + + # Check each parameter + foreach ($parameter in $ParameterList) + { + $ParameterSource = $ServerConfiguration.$($parameter.name) + $ParameterNew = (Invoke-Expression -Command "`$$($parameter.name)") + if ($PSBoundParameters.ContainsKey($parameter.Name) ` + -and ($ParameterSource -ne $ParameterNew)) { + Write-Verbose -Message ( @( + "$($MyInvocation.MyCommand): " + $($LocalizedData.NamespaceServerConfigurationParameterNeedsUpdateMessage) ` + -f $parameter.Name,$ParameterSource,$ParameterNew + ) -join '' ) + $desiredConfigurationMatch = $false + } # if + } # foreach + + return $DesiredConfigurationMatch +} # Test-TargetResource + +# Helper Functions +function New-TerminatingError +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory)] + [String] $ErrorId, + + [Parameter(Mandatory)] + [String] $ErrorMessage, + + [Parameter(Mandatory)] + [System.Management.Automation.ErrorCategory] $ErrorCategory + ) + + $exception = New-Object ` + -TypeName System.InvalidOperationException ` + -ArgumentList $errorMessage + $errorRecord = New-Object ` + -TypeName System.Management.Automation.ErrorRecord ` + -ArgumentList $exception, $errorId, $errorCategory, $null + $PSCmdlet.ThrowTerminatingError($errorRecord) +} + +Export-ModuleMember -Function *-TargetResource diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof new file mode 100644 index 0000000..d8a9efd --- /dev/null +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof @@ -0,0 +1,11 @@ +[ClassVersion("1.0.0.0"), FriendlyName("xDFSNamespaceServerConfiguration")] +class MSFT_xDFSNamespaceServerConfiguration : OMI_BaseResource +{ + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Specifies a time-out value, in seconds, for Lightweight Directory Access Protocol (LDAP) requests for the DFS namespace server.")] Uint32 LdapTimeoutSec; + [Write, Description("Indicates whether this server provides only in-site referrals.")] Boolean EnableInsiteReferrals; + [Write, Description("Indicates whether the server can use cost-based selection.")] Boolean EnableSiteCostedReferrals; + [Write, Description("Indicates whether to prefer the logon domain controller in referrals.")] Boolean PreferLogonDC; + [Write, Description("This interval controls how often domain-based DFS namespace root servers and domain controllers connect to the PDC emulator to get updates of DFS namespace metadata.")] Uint32 SyncIntervalSec; + [Write, Description("Indicates whether a DFS namespace server uses FQDNs in referrals.")] Boolean UseFQDN; +}; diff --git a/Examples/Sample_xDFSNamespaceRoot_Domain_MultipleTarget.ps1 b/Examples/Sample_xDFSNamespace_Domain_MultipleTarget.ps1 similarity index 100% rename from Examples/Sample_xDFSNamespaceRoot_Domain_MultipleTarget.ps1 rename to Examples/Sample_xDFSNamespace_Domain_MultipleTarget.ps1 diff --git a/Examples/Sample_xDFSNamespaceRoot_Domain_SingleTarget.ps1 b/Examples/Sample_xDFSNamespace_Domain_SingleTarget.ps1 similarity index 100% rename from Examples/Sample_xDFSNamespaceRoot_Domain_SingleTarget.ps1 rename to Examples/Sample_xDFSNamespace_Domain_SingleTarget.ps1 diff --git a/Examples/Sample_xDFSNamespaceRoot_Standalone.ps1 b/Examples/Sample_xDFSNamespace_Standalone.ps1 similarity index 88% rename from Examples/Sample_xDFSNamespaceRoot_Standalone.ps1 rename to Examples/Sample_xDFSNamespace_Standalone.ps1 index 9d55180..a876b1f 100644 --- a/Examples/Sample_xDFSNamespaceRoot_Standalone.ps1 +++ b/Examples/Sample_xDFSNamespace_Standalone.ps1 @@ -1,4 +1,4 @@ -Configuration DFSNamespace_Standalone_Public +Configuration DFSNamespace_Standalone { param ( @@ -12,10 +12,10 @@ Configuration DFSNamespace_Standalone_Public { # Install the Prerequisite features first # Requires Windows Server 2012 R2 Full install - WindowsFeature RSATDFSMgmtConInstall - { - Ensure = "Present" - Name = "RSAT-DFS-Mgmt-Con" + WindowsFeature RSATDFSMgmtConInstall + { + Ensure = "Present" + Name = "RSAT-DFS-Mgmt-Con" } WindowsFeature DFS @@ -56,7 +56,7 @@ $ConfigData = @{ } ) } -DFSNamespace_Standalone_Public ` +DFSNamespace_Standalone ` -configurationData $ConfigData ` -Credential (Get-Credential -Message "Domain Credentials") Start-DscConfiguration ` @@ -64,5 +64,5 @@ Start-DscConfiguration ` -Force ` -Verbose ` -ComputerName $ComputerName ` - -Path $PSScriptRoot\DFSNamespace_Standalone_Public ` + -Path $PSScriptRoot\DFSNamespace_Standalone ` -Credential (Get-Credential -Message "Local Admin Credentials on Remote Machine") diff --git a/Examples/Sample_xDFSNamespace_Standalone_FQDN.ps1 b/Examples/Sample_xDFSNamespace_Standalone_FQDN.ps1 new file mode 100644 index 0000000..da4b4db --- /dev/null +++ b/Examples/Sample_xDFSNamespace_Standalone_FQDN.ps1 @@ -0,0 +1,76 @@ +Configuration DFSNamespace_Standalone_FQDN +{ + param + ( + [Parameter(Mandatory)] + [pscredential] $Credential + ) + + Import-DscResource -ModuleName 'xDFS' + + Node $NodeName + { + # Install the Prerequisite features first + # Requires Windows Server 2012 R2 Full install + WindowsFeature RSATDFSMgmtConInstall + { + Ensure = "Present" + Name = "RSAT-DFS-Mgmt-Con" + } + + WindowsFeature DFS + { + Name = 'FS-DFS-Namespace' + Ensure = 'Present' + } + + # Configure the namespace server + xDFSNamespaceServerConfiguration DFSNamespaceConfig + { + IsSingleInstance = 'Yes' + UseFQDN = $true + PsDscRunAsCredential = $Credential + } # End of xDFSNamespaceServerConfiguration Resource + + # Configure the namespace + xDFSNamespaceRoot DFSNamespaceRoot_Standalone_Public + { + Path = '\\fileserver1.contoso.com\public' + TargetPath = '\\fileserver1.contoso.com\public' + Ensure = 'present' + Type = 'Standalone' + Description = 'Standalone DFS namespace for storing public files' + PsDscRunAsCredential = $Credential + } # End of DFSNamespaceRoot Resource + + # Configure the namespace folder + xDFSNamespaceFolder DFSNamespaceFolder_Standalone_PublicBrochures + { + Path = '\\fileserver1.contoso.com\public\brochures' + TargetPath = '\\fileserver2.contoso.com\brochures' + Ensure = 'present' + Description = 'Standalone DFS namespace for storing public brochure files' + PsDscRunAsCredential = $Credential + } # End of DFSNamespaceFolder Resource + } +} +$ComputerName = Read-Host -Prompt 'Computer Name' +$ConfigData = @{ + AllNodes = @( + @{ + Nodename = $ComputerName + CertificateFile = "C:\publicKeys\targetNode.cer" + Thumbprint = "AC23EA3A9E291A75757A556D0B71CBBF8C4F6FD8" + } + ) +} +DFSNamespace_Standalone_FQDN ` + -configurationData $ConfigData ` + -Credential (Get-Credential -Message "Domain Credentials") +Start-DscConfiguration ` + -Wait ` + -Force ` + -Verbose ` + -ComputerName $ComputerName ` + -Path $PSScriptRoot\DFSNamespace_Standalone_FQDN ` + -Credential (Get-Credential -Message "Local Admin Credentials on Remote Machine") diff --git a/README.md b/README.md index 3d585c8..674781d 100644 --- a/README.md +++ b/README.md @@ -155,10 +155,10 @@ configuration Sample_xDFSReplicationGroup { # Install the Prerequisite features first # Requires Windows Server 2012 R2 Full install - WindowsFeature RSATDFSMgmtConInstall - { - Ensure = "Present" - Name = "RSAT-DFS-Mgmt-Con" + WindowsFeature RSATDFSMgmtConInstall + { + Ensure = "Present" + Name = "RSAT-DFS-Mgmt-Con" } # Configure the Replication Group @@ -374,6 +374,18 @@ This resource is used to create, edit or remove folders from DFS namespaces. Wh * **ReferralPriorityClass**: Specifies the target priority class for a DFS namespace folder. { Global-High | SiteCost-High | SiteCost-Normal | SiteCost-Low | Global-Low }. Optional. * **ReferralPriorityRank**: Specifies the priority rank, as an integer, for a target in the DFS namespace. Uint32. Optional +### xDFSNamespaceServerConfiguration +This resource is used to configure DFS Namespace server settings. This is a single instance resource that can only be used once in a DSC Configuration. + +#### Parameters +* **IsSingleInstance**: Specifies if the resource is a single instance, the value must be 'Yes'. Required. +* **LdapTimeoutSec**: Specifies a time-out value, in seconds, for Lightweight Directory Access Protocol (LDAP) requests for the DFS namespace server. Uint32. Optional. +* **EnableInsiteReferrals**: Indicates whether this server provides only in-site referrals. Boolean. Optional. +* **EnableSiteCostedReferrals**: Indicates whether the server can use cost-based selection. Boolean. Optional. +* **PreferLogonDC**: Indicates whether to prefer the logon domain controller in referrals. Boolean. Optional. +* **SyncIntervalSec**: This interval controls how often domain-based DFS namespace root servers and domain controllers connect to the PDC emulator to get updates of DFS namespace metadata. Uint32. Optional. +* **UseFQDN**: Indicates whether a DFS namespace server uses FQDNs in referrals. Boolean. Optional. + ### Examples Create an AD Domain V2 based DFS namespace called departments in the domain contoso.com with a single root target on the computer fs_1. Two subfolders are defined with targets that direct to shares on servers fs_3 and fs_8. ```powershell @@ -406,7 +418,7 @@ Configuration DFSNamespace_Domain_SingleTarget # Configure the namespace xDFSNamespaceRoot DFSNamespaceRoot_Domain_Departments { - Path = '\\contoso.com\departments' + Path = '\\contoso.com\departments' TargetPath = '\\fs_1\departments' Ensure = 'present' Type = 'DomainV2' @@ -418,7 +430,7 @@ Configuration DFSNamespace_Domain_SingleTarget # Configure the namespace folders xDFSNamespaceFolder DFSNamespaceFolder_Domain_Finance { - Path = '\\contoso.com\departments\finance' + Path = '\\contoso.com\departments\finance' TargetPath = '\\fs_3\Finance' Ensure = 'present' Description = 'AD Domain based DFS namespace folder for storing finance files' @@ -428,7 +440,7 @@ Configuration DFSNamespace_Domain_SingleTarget xDFSNamespaceFolder DFSNamespaceFolder_Domain_Management { - Path = '\\contoso.com\departments\management' + Path = '\\contoso.com\departments\management' TargetPath = '\\fs_8\Management' Ensure = 'present' Description = 'AD Domain based DFS namespace folder for storing management files' @@ -572,7 +584,7 @@ Start-DscConfiguration ` Create a standalone DFS namespace called public on the server fileserver1. A namespace folder called Brochures is also created in this namespace that targets the \\fileserver2\brochures share. ```powershell -Configuration DFSNamespace_Standalone_Public +Configuration DFSNamespace_Standalone { param ( @@ -587,7 +599,7 @@ Configuration DFSNamespace_Standalone_Public # Install the Prerequisite features first # Requires Windows Server 2012 R2 Full install WindowsFeature RSATDFSMgmtConInstall - { + { Ensure = "Present" Name = "RSAT-DFS-Mgmt-Con" } @@ -630,7 +642,87 @@ $ConfigData = @{ } ) } -DFSNamespace_Standalone_Public ` +DFSNamespace_Standalone ` + -configurationData $ConfigData ` + -Credential (Get-Credential -Message "Domain Credentials") +Start-DscConfiguration ` + -Wait ` + -Force ` + -Verbose ` + -ComputerName $ComputerName ` + -Path $PSScriptRoot\DFSNamespace_Standalone ` + -Credential (Get-Credential -Message "Local Admin Credentials on Remote Machine") +``` + +Create a standalone DFS namespace using FQDN called public on the server fileserver1.contoso.com. A namespace folder called Brochures is also created in this namespace that targets the \\fileserver2.contoso.com\brochures share. +```powershell +Configuration DFSNamespace_Standalone_FQDN +{ + param + ( + [Parameter(Mandatory)] + [pscredential] $Credential + ) + + Import-DscResource -ModuleName 'xDFS' + + Node $NodeName + { + # Install the Prerequisite features first + # Requires Windows Server 2012 R2 Full install + WindowsFeature RSATDFSMgmtConInstall + { + Ensure = "Present" + Name = "RSAT-DFS-Mgmt-Con" + } + + WindowsFeature DFS + { + Name = 'FS-DFS-Namespace' + Ensure = 'Present' + } + + # Configure the namespace server + xDFSNamespaceServerConfiguration DFSNamespaceConfig + { + IsSingleInstance = 'Yes' + UseFQDN = $true + PsDscRunAsCredential = $Credential + } # End of xDFSNamespaceServerConfiguration Resource + + # Configure the namespace + xDFSNamespaceRoot DFSNamespaceRoot_Standalone_Public + { + Path = '\\fileserver1.contoso.com\public' + TargetPath = '\\fileserver1.contoso.com\public' + Ensure = 'present' + Type = 'Standalone' + Description = 'Standalone DFS namespace for storing public files' + PsDscRunAsCredential = $Credential + } # End of DFSNamespaceRoot Resource + + # Configure the namespace folder + xDFSNamespaceFolder DFSNamespaceFolder_Standalone_PublicBrochures + { + Path = '\\fileserver1.contoso.com\public\brochures' + TargetPath = '\\fileserver2.contoso.com\brochures' + Ensure = 'present' + Description = 'Standalone DFS namespace for storing public brochure files' + PsDscRunAsCredential = $Credential + } # End of DFSNamespaceFolder Resource + } +} +$ComputerName = Read-Host -Prompt 'Computer Name' +$ConfigData = @{ + AllNodes = @( + @{ + Nodename = $ComputerName + CertificateFile = "C:\publicKeys\targetNode.cer" + Thumbprint = "AC23EA3A9E291A75757A556D0B71CBBF8C4F6FD8" + } + ) +} +DFSNamespace_Standalone_FQDN ` -configurationData $ConfigData ` -Credential (Get-Credential -Message "Domain Credentials") Start-DscConfiguration ` @@ -638,12 +730,14 @@ Start-DscConfiguration ` -Force ` -Verbose ` -ComputerName $ComputerName ` - -Path $PSScriptRoot\DFSNamespace_Standalone_Public ` + -Path $PSScriptRoot\DFSNamespace_Standalone_FQDN ` -Credential (Get-Credential -Message "Local Admin Credentials on Remote Machine") ``` ## Versions ### Unreleased +* MSFT_xDFSNamespaceServerConfiguration- resource added. +* Corrected names of DFS Namespace sample files to indicate that they are not just setting Namespace roots. * Removed Pester version from AppVeyor.yml. ### 3.0.0.0 @@ -660,8 +754,8 @@ Start-DscConfiguration ` * MSFT_xDFSRepGroup- Fixed issue when using FQDN member names. * MSFT_xDFSRepGroupMembership- Fixed issue with Get-TargetResource when using FQDN ComputerName. * MSFT_xDFSRepGroupConnection- Fixed issue with Get-TargetResource when using FQDN SourceComputerName or FQDN DestinationComputerName. -* MSFT_xDFSNamespaceRoot- Added write support to TimeToLiveSec parameter. -* MSFT_xDFSNamespaceFolder- Added write support to TimeToLiveSec parameter. +* MSFT_xDFSNamespaceRoot- Added write support to TimeToLiveSec parameter. +* MSFT_xDFSNamespaceFolder- Added write support to TimeToLiveSec parameter. ### 2.0.0.0 * MSFT_xDFSNamespaceRoot- resource added. diff --git a/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 new file mode 100644 index 0000000..7a4c1ef --- /dev/null +++ b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 @@ -0,0 +1,88 @@ +$Global:DSCModuleName = 'xDFS' +$Global:DSCResourceName = 'MSFT_xDFSNamespaceServerConfiguration' + +#region HEADER +# Integration Test Template Version: 1.1.0 +[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) +if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` + (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) +{ + & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $moduleRoot -ChildPath '\DSCResource.Tests\')) +} + +Import-Module (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +$TestEnvironment = Initialize-TestEnvironment ` + -DSCModuleName $Global:DSCModuleName ` + -DSCResourceName $Global:DSCResourceName ` + -TestType Integration +#endregion + +# Using try/finally to always cleanup even if something awful happens. +try +{ + # Ensure that the tests can be performed on this computer + $ProductType = (Get-CimInstance Win32_OperatingSystem).ProductType + Describe 'Environment' { + Context 'Operating System' { + It 'Should be a Server OS' { + $ProductType | Should Be 3 + } + } + } + if ($ProductType -ne 3) + { + Break + } + + $Installed = (Get-WindowsFeature -Name FS-DFS-Namespace).Installed + Describe 'Environment' { + Context 'Windows Features' { + It 'Should have the DFS Namespace Feature Installed' { + $Installed | Should Be $true + } + } + } + if ($Installed -eq $false) + { + Break + } + + #region Integration Tests + $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($Global:DSCResourceName).config.ps1" + . $ConfigFile + + Describe "$($Global:DSCResourceName)_Integration" { + #region DEFAULT TESTS + It 'Should compile without throwing' { + { + Invoke-Expression -Command "$($Global:DSCResourceName)_Config -OutputPath `$TestEnvironment.WorkingFolder" + Start-DscConfiguration -Path $TestEnvironment.WorkingFolder -ComputerName localhost -Wait -Verbose -Force + } | Should not throw + } + + It 'should be able to call Get-DscConfiguration without throwing' { + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw + } + #endregion + + It 'Should have set the resource and all the parameters should match' { + # Get the Rule details + $NamespaceServerConfigurationNew = Get-DfsnServerConfiguration -ComputerName LocalHost + $NamespaceServerConfigurationNew.LdapTimeoutSec = $NamespaceServerConfiguration.LdapTimeoutSec + $NamespaceServerConfigurationNew.EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals + $NamespaceServerConfigurationNew.EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals + $NamespaceServerConfigurationNew.PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC + $NamespaceServerConfigurationNew.SyncIntervalSec = $NamespaceServerConfiguration.SyncIntervalSec + $NamespaceServerConfigurationNew.UseFQDN = $NamespaceServerConfiguration.UseFQDN + } + + # Clean up + } + #endregion +} +finally +{ + #region FOOTER + Restore-TestEnvironment -TestEnvironment $TestEnvironment + #endregion +} diff --git a/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 new file mode 100644 index 0000000..a9fa317 --- /dev/null +++ b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 @@ -0,0 +1,23 @@ +$NamespaceServerConfiguration = @{ + LdapTimeoutSec = 45 + EnableInsiteReferrals = $True + EnableSiteCostedReferrals = $True + PreferLogonDC = $True + SyncIntervalSec = 20 + UseFQDN = $True +} + +Configuration MSFT_xDFSNamespaceServerConfiguration_Config { + Import-DscResource -ModuleName xDFS + node localhost { + xDFSNamespaceRoot Integration_Test { + IsSingleInstance = 'Yes' + LdapTimeoutSec = $NamespaceServerConfiguration.LdapTimeoutSec + EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals + EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals + PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC + SyncIntervalSec = $NamespaceServerConfiguration.SyncIntervalSec + UseFQDN = $NamespaceServerConfiguration.UseFQDN + } + } +} diff --git a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 new file mode 100644 index 0000000..a73c3fb --- /dev/null +++ b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 @@ -0,0 +1,307 @@ +$Global:DSCModuleName = 'xDFS' +$Global:DSCResourceName = 'MSFT_xDFSNamespaceServerConfiguration' + +#region HEADER +# Unit Test Template Version: 1.1.0 +[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) +if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` + (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) +{ + & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $moduleRoot -ChildPath '\DSCResource.Tests\')) +} + +Import-Module (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +$TestEnvironment = Initialize-TestEnvironment ` + -DSCModuleName $Global:DSCModuleName ` + -DSCResourceName $Global:DSCResourceName ` + -TestType Unit +#endregion HEADER + +# Begin Testing +try +{ + # Ensure that the tests can be performed on this computer + $ProductType = (Get-CimInstance Win32_OperatingSystem).ProductType + Describe 'Environment' { + Context 'Operating System' { + It 'Should be a Server OS' { + $ProductType | Should Be 3 + } + } + } + if ($ProductType -ne 3) + { + Break + } + + $Installed = (Get-WindowsFeature -Name FS-DFS-Namespace).Installed + Describe 'Environment' { + Context 'Windows Features' { + It 'Should have the DFS Namespace Feature Installed' { + $Installed | Should Be $true + } + } + } + if ($Installed -eq $false) + { + Break + } + + #region Pester Tests + InModuleScope $Global:DSCResourceName { + + # Create the Mock Objects that will be used for running tests + $NamespaceServerConfiguration = [PSObject]@{ + LdapTimeoutSec = 45 + EnableInsiteReferrals = $True + EnableSiteCostedReferrals = $True + PreferLogonDC = $True + SyncIntervalSec = 20 + UseFQDN = $True + } + $NamespaceServerConfigurationSplat = [PSObject]@{ + IsSingleInstance = 'Yes' + LdapTimeoutSec = $NamespaceServerConfiguration.EnableInsiteReferrals + EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals + EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals + PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC + SyncIntervalSec = $NamespaceServerConfiguration.SyncIntervalSec + UseFQDN = $NamespaceServerConfiguration.UseFQDN + } + + Describe "$($Global:DSCResourceName)\Get-TargetResource" { + + Context 'Namespace Server Configuration Exists' { + + Mock Get-DFSNServerConfiguration -MockWith { $NamespaceServerConfiguration } + + It 'should return correct namespace server configuration values' { + $Result = Get-TargetResource -IsSingleInstance 'Yes' + $Result.LdapTimeoutSec | Should Be $NamespaceServerConfiguration.LdapTimeoutSec + $Result.EnableInsiteReferrals | Should Be $NamespaceServerConfiguration.EnableInsiteReferrals + $Result.EnableSiteCostedReferrals | Should Be $NamespaceServerConfiguration.EnableSiteCostedReferrals + $Result.PreferLogonDC | Should Be $NamespaceServerConfiguration.PreferLogonDC + $Result.SyncIntervalSec | Should Be $NamespaceServerConfiguration.SyncIntervalSec + $Result.UseFQDN | Should Be $NamespaceServerConfiguration.UseFQDN + } + It 'should call the expected mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + } + + Describe "$($Global:DSCResourceName)\Set-TargetResource" { + + Mock Get-DFSNServerConfiguration -MockWith { $NamespaceServerConfiguration } + Mock Set-DFSNServerConfiguration + + Context 'Namespace Server Configuration all parameters are the same' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 0 + } + } + + Context 'Namespace Server Configuration LdapTimeoutSec is different' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + $Splat.LdapTimeoutSec = $Splat.LdapTimeoutSec + 1 + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration EnableInsiteReferrals is different' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + $Splat.EnableInsiteReferrals = -not $Splat.EnableInsiteReferrals + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration EnableSiteCostedReferrals is different' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + $Splat.EnableSiteCostedReferrals = -not $Splat.EnableSiteCostedReferrals + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration PreferLogonDC is different' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + $Splat.PreferLogonDC = -not $Splat.PreferLogonDC + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration SyncIntervalSec is different' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + $Splat.SyncIntervalSec = $Splat.SyncIntervalSec + 1 + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration UseFQDN is different' { + It 'should not throw error' { + { + $Splat = $NamespaceServerConfigurationSplat.Clone() + $Splat.UseFQDN = -not $Splat.UseFQDN + Set-TargetResource @Splat + } | Should Not Throw + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 + } + } + } + + Describe "$($Global:DSCResourceName)\Test-TargetResource" { + + Mock Get-DFSNServerConfiguration + + Context 'Namespace Server Configuration all parameters are the same' { + It 'should return true' { + $Splat = $Namespace.Clone() + Test-TargetResource @Splat | Should Be $True + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration LdapTimeoutSec is different' { + It 'should return false' { + $Splat = $Namespace.Clone() + $Splat.LdapTimeoutSec = $Splat.LdapTimeoutSec + 1 + Test-TargetResource @Splat | Should Be $False + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration EnableInsiteReferrals is different' { + It 'should return false' { + $Splat = $Namespace.Clone() + $Splat.EnableInsiteReferrals = -not $Splat.EnableInsiteReferrals + Test-TargetResource @Splat | Should Be $False + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration EnableSiteCostedReferrals is different' { + It 'should return false' { + $Splat = $Namespace.Clone() + $Splat.EnableSiteCostedReferrals = -not $Splat.EnableSiteCostedReferrals + Test-TargetResource @Splat | Should Be $False + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration PreferLogonDC is different' { + It 'should return false' { + $Splat = $Namespace.Clone() + $Splat.PreferLogonDC = -not $Splat.PreferLogonDC + Test-TargetResource @Splat | Should Be $False + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration SyncIntervalSec is different' { + It 'should return false' { + $Splat = $Namespace.Clone() + $Splat.SyncIntervalSec = $Splat.SyncIntervalSec + 1 + Test-TargetResource @Splat | Should Be $False + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + + Context 'Namespace Server Configuration UseFQDN is different' { + It 'should return false' { + $Splat = $Namespace.Clone() + $Splat.UseFQDN = -not $Splat.UseFQDN + Test-TargetResource @Splat | Should Be $False + } + It 'should call expected Mocks' { + Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 + } + } + } + + Describe "$($Global:DSCResourceName)\New-TerminatingError" { + + Context 'Create a TestError Exception' { + + It 'should throw an TestError exception' { + $errorId = 'TestError' + $errorCategory = [System.Management.Automation.ErrorCategory]::InvalidArgument + $errorMessage = 'Test Error Message' + $exception = New-Object ` + -TypeName System.InvalidOperationException ` + -ArgumentList $errorMessage + $errorRecord = New-Object ` + -TypeName System.Management.Automation.ErrorRecord ` + -ArgumentList $exception, $errorId, $errorCategory, $null + + { New-TerminatingError ` + -ErrorId $errorId ` + -ErrorMessage $errorMessage ` + -ErrorCategory $errorCategory } | Should Throw $errorRecord + } + } + } + } + #endregion +} +finally +{ + #region FOOTER + Restore-TestEnvironment -TestEnvironment $TestEnvironment + #endregion +} From 17b12660ccfa4689af4c73b3d1b88e2f6b877bd4 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 18:26:02 +1200 Subject: [PATCH 03/13] Fix to xDFSNamespaceServerConfiguration --- .../MSFT_xDFSNamespaceServerConfiguration.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 index b1e9021..9dfc9fe 100644 --- a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 @@ -25,7 +25,7 @@ data ParameterList @{ Name = 'EnableSiteCostedReferrals'; Type = 'Boolean' }, @{ Name = 'PreferLogonDC'; Type = 'Boolean' }, @{ Name = 'SyncIntervalSec'; Type = 'String' }, - @{ Name = 'UseFQDN'; Type = 'Uint32'; Restart = $True } + @{ Name = 'UseFQDN'; Type = 'Uint32'; Restart = $True } ) } @@ -118,7 +118,7 @@ function Set-TargetResource $ParameterSource = $ServerConfiguration.$($parameter.name) $ParameterNew = (Invoke-Expression -Command "`$$($parameter.name)") if ($PSBoundParameters.ContainsKey($parameter.Name) ` - -and ($ParameterSource -ne $ParameterNew)) { + -and ($ParameterSource -ne $ParameterNew)) { $ChangeParameters += @{ $($parameter.name) = $ParameterNew From 0692c9bd1977ac0d874f743c70fa52e2bfd4a7ea Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 18:47:54 +1200 Subject: [PATCH 04/13] Changed readme.md to trigger AppVeyor.yml build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 674781d..90a93c8 100644 --- a/README.md +++ b/README.md @@ -737,7 +737,7 @@ Start-DscConfiguration ` ## Versions ### Unreleased * MSFT_xDFSNamespaceServerConfiguration- resource added. -* Corrected names of DFS Namespace sample files to indicate that they are not just setting Namespace roots. +* Corrected names of DFS Namespace sample files to indicate that they are setting Namespace roots and folders. * Removed Pester version from AppVeyor.yml. ### 3.0.0.0 From c57fc16764c50359a5d7a29df5186b297e9817d8 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 19:05:58 +1200 Subject: [PATCH 05/13] Fix unit tests --- Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 index a73c3fb..e6733be 100644 --- a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 +++ b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 @@ -61,7 +61,7 @@ try } $NamespaceServerConfigurationSplat = [PSObject]@{ IsSingleInstance = 'Yes' - LdapTimeoutSec = $NamespaceServerConfiguration.EnableInsiteReferrals + LdapTimeoutSec = $NamespaceServerConfiguration.LdapTimeoutSec EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC From 583bb10965db0f01e6b8bb753270123ea63d1e44 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 19:18:02 +1200 Subject: [PATCH 06/13] Fix unit tests --- ...MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 index e6733be..c92ff3d 100644 --- a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 +++ b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 @@ -199,7 +199,7 @@ try Context 'Namespace Server Configuration all parameters are the same' { It 'should return true' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() Test-TargetResource @Splat | Should Be $True } It 'should call expected Mocks' { @@ -209,7 +209,7 @@ try Context 'Namespace Server Configuration LdapTimeoutSec is different' { It 'should return false' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() $Splat.LdapTimeoutSec = $Splat.LdapTimeoutSec + 1 Test-TargetResource @Splat | Should Be $False } @@ -220,7 +220,7 @@ try Context 'Namespace Server Configuration EnableInsiteReferrals is different' { It 'should return false' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() $Splat.EnableInsiteReferrals = -not $Splat.EnableInsiteReferrals Test-TargetResource @Splat | Should Be $False } @@ -231,7 +231,7 @@ try Context 'Namespace Server Configuration EnableSiteCostedReferrals is different' { It 'should return false' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() $Splat.EnableSiteCostedReferrals = -not $Splat.EnableSiteCostedReferrals Test-TargetResource @Splat | Should Be $False } @@ -242,7 +242,7 @@ try Context 'Namespace Server Configuration PreferLogonDC is different' { It 'should return false' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() $Splat.PreferLogonDC = -not $Splat.PreferLogonDC Test-TargetResource @Splat | Should Be $False } @@ -253,7 +253,7 @@ try Context 'Namespace Server Configuration SyncIntervalSec is different' { It 'should return false' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() $Splat.SyncIntervalSec = $Splat.SyncIntervalSec + 1 Test-TargetResource @Splat | Should Be $False } @@ -264,7 +264,7 @@ try Context 'Namespace Server Configuration UseFQDN is different' { It 'should return false' { - $Splat = $Namespace.Clone() + $Splat = $NamespaceServerConfigurationSplat.Clone() $Splat.UseFQDN = -not $Splat.UseFQDN Test-TargetResource @Splat | Should Be $False } From b922abee95c565277853c890a0407d91d6290505 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 19:25:54 +1200 Subject: [PATCH 07/13] Spike to invx problem with Test-ResourceModule --- .../MSFT_xDFSNamespaceServerConfiguration.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 index 9dfc9fe..e22fdab 100644 --- a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 @@ -217,7 +217,7 @@ function Test-TargetResource $ParameterNew = (Invoke-Expression -Command "`$$($parameter.name)") if ($PSBoundParameters.ContainsKey($parameter.Name) ` -and ($ParameterSource -ne $ParameterNew)) { - Write-Verbose -Message ( @( + Write-Verbose -Verbose -Message ( @( "$($MyInvocation.MyCommand): " $($LocalizedData.NamespaceServerConfigurationParameterNeedsUpdateMessage) ` -f $parameter.Name,$ParameterSource,$ParameterNew From a8d9b21e2119e6c1bd89188d467a9ed50265e31c Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 19:34:43 +1200 Subject: [PATCH 08/13] Revert spike and fix unit tests --- Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 index c92ff3d..aef2c3d 100644 --- a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 +++ b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 @@ -195,7 +195,7 @@ try Describe "$($Global:DSCResourceName)\Test-TargetResource" { - Mock Get-DFSNServerConfiguration + Mock Get-DFSNServerConfiguration -MockWith { $NamespaceServerConfiguration } Context 'Namespace Server Configuration all parameters are the same' { It 'should return true' { From 0e3e12a839e5f7448176b24cedfd9a5c562b18e8 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 19:40:32 +1200 Subject: [PATCH 09/13] Revert spike --- .../MSFT_xDFSNamespaceServerConfiguration.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 index e22fdab..9dfc9fe 100644 --- a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 @@ -217,7 +217,7 @@ function Test-TargetResource $ParameterNew = (Invoke-Expression -Command "`$$($parameter.name)") if ($PSBoundParameters.ContainsKey($parameter.Name) ` -and ($ParameterSource -ne $ParameterNew)) { - Write-Verbose -Verbose -Message ( @( + Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " $($LocalizedData.NamespaceServerConfigurationParameterNeedsUpdateMessage) ` -f $parameter.Name,$ParameterSource,$ParameterNew From 3c64a34701af208805c237626695b7e446361ee6 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 20:25:13 +1200 Subject: [PATCH 10/13] Remove parameters from xDFSNamespaceServerConfiguration because they throw errors when reading/writing --- ...MSFT_xDFSNamespaceServerConfiguration.psm1 | 21 ----- ...DFSNamespaceServerConfiguration.schema.mof | 3 - README.md | 3 - ...eServerConfiguration.Integration.Tests.ps1 | 12 ++- ...DFSNamespaceServerConfiguration.config.ps1 | 10 +-- ...xDFSNamespaceServerConfiguration.Tests.ps1 | 86 +------------------ 6 files changed, 12 insertions(+), 123 deletions(-) diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 index 9dfc9fe..0ff3334 100644 --- a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.psm1 @@ -21,9 +21,6 @@ data ParameterList { @( @{ Name = 'LdapTimeoutSec'; Type = 'Uint32' }, - @{ Name = 'EnableInsiteReferrals'; Type = 'Boolean' }, - @{ Name = 'EnableSiteCostedReferrals'; Type = 'Boolean' }, - @{ Name = 'PreferLogonDC'; Type = 'Boolean' }, @{ Name = 'SyncIntervalSec'; Type = 'String' }, @{ Name = 'UseFQDN'; Type = 'Uint32'; Restart = $True } ) @@ -80,15 +77,6 @@ function Set-TargetResource [Uint32] $LdapTimeoutSec, - [Boolean] - $EnableInsiteReferrals, - - [Boolean] - $EnableSiteCostedReferrals, - - [Boolean] - $PreferLogonDC, - [Uint32] $SyncIntervalSec, @@ -177,15 +165,6 @@ function Test-TargetResource [Uint32] $LdapTimeoutSec, - [Boolean] - $EnableInsiteReferrals, - - [Boolean] - $EnableSiteCostedReferrals, - - [Boolean] - $PreferLogonDC, - [Uint32] $SyncIntervalSec, diff --git a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof index d8a9efd..e43822e 100644 --- a/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof +++ b/DSCResources/MSFT_xDFSNamespaceServerConfiguration/MSFT_xDFSNamespaceServerConfiguration.schema.mof @@ -3,9 +3,6 @@ class MSFT_xDFSNamespaceServerConfiguration : OMI_BaseResource { [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [Write, Description("Specifies a time-out value, in seconds, for Lightweight Directory Access Protocol (LDAP) requests for the DFS namespace server.")] Uint32 LdapTimeoutSec; - [Write, Description("Indicates whether this server provides only in-site referrals.")] Boolean EnableInsiteReferrals; - [Write, Description("Indicates whether the server can use cost-based selection.")] Boolean EnableSiteCostedReferrals; - [Write, Description("Indicates whether to prefer the logon domain controller in referrals.")] Boolean PreferLogonDC; [Write, Description("This interval controls how often domain-based DFS namespace root servers and domain controllers connect to the PDC emulator to get updates of DFS namespace metadata.")] Uint32 SyncIntervalSec; [Write, Description("Indicates whether a DFS namespace server uses FQDNs in referrals.")] Boolean UseFQDN; }; diff --git a/README.md b/README.md index 90a93c8..55f7947 100644 --- a/README.md +++ b/README.md @@ -380,9 +380,6 @@ This resource is used to configure DFS Namespace server settings. This is a sing #### Parameters * **IsSingleInstance**: Specifies if the resource is a single instance, the value must be 'Yes'. Required. * **LdapTimeoutSec**: Specifies a time-out value, in seconds, for Lightweight Directory Access Protocol (LDAP) requests for the DFS namespace server. Uint32. Optional. -* **EnableInsiteReferrals**: Indicates whether this server provides only in-site referrals. Boolean. Optional. -* **EnableSiteCostedReferrals**: Indicates whether the server can use cost-based selection. Boolean. Optional. -* **PreferLogonDC**: Indicates whether to prefer the logon domain controller in referrals. Boolean. Optional. * **SyncIntervalSec**: This interval controls how often domain-based DFS namespace root servers and domain controllers connect to the PDC emulator to get updates of DFS namespace metadata. Uint32. Optional. * **UseFQDN**: Indicates whether a DFS namespace server uses FQDNs in referrals. Boolean. Optional. diff --git a/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 index 7a4c1ef..aa4e936 100644 --- a/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.Integration.Tests.ps1 @@ -47,6 +47,10 @@ try Break } + # Backup the existing settings + $ServerConfigurationBackup = Get-DFSNServerConfiguration ` + -ComputerName LocalHost + #region Integration Tests $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($Global:DSCResourceName).config.ps1" . $ConfigFile @@ -69,14 +73,16 @@ try # Get the Rule details $NamespaceServerConfigurationNew = Get-DfsnServerConfiguration -ComputerName LocalHost $NamespaceServerConfigurationNew.LdapTimeoutSec = $NamespaceServerConfiguration.LdapTimeoutSec - $NamespaceServerConfigurationNew.EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals - $NamespaceServerConfigurationNew.EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals - $NamespaceServerConfigurationNew.PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC $NamespaceServerConfigurationNew.SyncIntervalSec = $NamespaceServerConfiguration.SyncIntervalSec $NamespaceServerConfigurationNew.UseFQDN = $NamespaceServerConfiguration.UseFQDN } # Clean up + Set-DFSNServerConfiguration ` + -ComputerName LocalHost ` + -LdapTimeoutSec $ServerConfigurationBackup.LdapTimeoutSec ` + -SyncIntervalSec $ServerConfigurationBackup.SyncIntervalSec ` + -UseFQDN $ServerConfigurationBackup.UseFQDN } #endregion } diff --git a/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 index a9fa317..0409669 100644 --- a/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 +++ b/Tests/Integration/MSFT_xDFSNamespaceServerConfiguration.config.ps1 @@ -1,21 +1,15 @@ $NamespaceServerConfiguration = @{ LdapTimeoutSec = 45 - EnableInsiteReferrals = $True - EnableSiteCostedReferrals = $True - PreferLogonDC = $True - SyncIntervalSec = 20 + SyncIntervalSec = 5000 UseFQDN = $True } Configuration MSFT_xDFSNamespaceServerConfiguration_Config { Import-DscResource -ModuleName xDFS node localhost { - xDFSNamespaceRoot Integration_Test { + xDFSNamespaceServerConfiguration Integration_Test { IsSingleInstance = 'Yes' LdapTimeoutSec = $NamespaceServerConfiguration.LdapTimeoutSec - EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals - EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals - PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC SyncIntervalSec = $NamespaceServerConfiguration.SyncIntervalSec UseFQDN = $NamespaceServerConfiguration.UseFQDN } diff --git a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 index aef2c3d..a835f3c 100644 --- a/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 +++ b/Tests/Unit/MSFT_xDFSNamespaceServerConfiguration.Tests.ps1 @@ -53,18 +53,12 @@ try # Create the Mock Objects that will be used for running tests $NamespaceServerConfiguration = [PSObject]@{ LdapTimeoutSec = 45 - EnableInsiteReferrals = $True - EnableSiteCostedReferrals = $True - PreferLogonDC = $True - SyncIntervalSec = 20 + SyncIntervalSec = 5000 UseFQDN = $True } $NamespaceServerConfigurationSplat = [PSObject]@{ IsSingleInstance = 'Yes' LdapTimeoutSec = $NamespaceServerConfiguration.LdapTimeoutSec - EnableInsiteReferrals = $NamespaceServerConfiguration.EnableInsiteReferrals - EnableSiteCostedReferrals = $NamespaceServerConfiguration.EnableSiteCostedReferrals - PreferLogonDC = $NamespaceServerConfiguration.PreferLogonDC SyncIntervalSec = $NamespaceServerConfiguration.SyncIntervalSec UseFQDN = $NamespaceServerConfiguration.UseFQDN } @@ -78,9 +72,6 @@ try It 'should return correct namespace server configuration values' { $Result = Get-TargetResource -IsSingleInstance 'Yes' $Result.LdapTimeoutSec | Should Be $NamespaceServerConfiguration.LdapTimeoutSec - $Result.EnableInsiteReferrals | Should Be $NamespaceServerConfiguration.EnableInsiteReferrals - $Result.EnableSiteCostedReferrals | Should Be $NamespaceServerConfiguration.EnableSiteCostedReferrals - $Result.PreferLogonDC | Should Be $NamespaceServerConfiguration.PreferLogonDC $Result.SyncIntervalSec | Should Be $NamespaceServerConfiguration.SyncIntervalSec $Result.UseFQDN | Should Be $NamespaceServerConfiguration.UseFQDN } @@ -122,48 +113,6 @@ try } } - Context 'Namespace Server Configuration EnableInsiteReferrals is different' { - It 'should not throw error' { - { - $Splat = $NamespaceServerConfigurationSplat.Clone() - $Splat.EnableInsiteReferrals = -not $Splat.EnableInsiteReferrals - Set-TargetResource @Splat - } | Should Not Throw - } - It 'should call expected Mocks' { - Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 - Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 - } - } - - Context 'Namespace Server Configuration EnableSiteCostedReferrals is different' { - It 'should not throw error' { - { - $Splat = $NamespaceServerConfigurationSplat.Clone() - $Splat.EnableSiteCostedReferrals = -not $Splat.EnableSiteCostedReferrals - Set-TargetResource @Splat - } | Should Not Throw - } - It 'should call expected Mocks' { - Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 - Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 - } - } - - Context 'Namespace Server Configuration PreferLogonDC is different' { - It 'should not throw error' { - { - $Splat = $NamespaceServerConfigurationSplat.Clone() - $Splat.PreferLogonDC = -not $Splat.PreferLogonDC - Set-TargetResource @Splat - } | Should Not Throw - } - It 'should call expected Mocks' { - Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 - Assert-MockCalled -commandName Set-DFSNServerConfiguration -Exactly 1 - } - } - Context 'Namespace Server Configuration SyncIntervalSec is different' { It 'should not throw error' { { @@ -218,39 +167,6 @@ try } } - Context 'Namespace Server Configuration EnableInsiteReferrals is different' { - It 'should return false' { - $Splat = $NamespaceServerConfigurationSplat.Clone() - $Splat.EnableInsiteReferrals = -not $Splat.EnableInsiteReferrals - Test-TargetResource @Splat | Should Be $False - } - It 'should call expected Mocks' { - Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 - } - } - - Context 'Namespace Server Configuration EnableSiteCostedReferrals is different' { - It 'should return false' { - $Splat = $NamespaceServerConfigurationSplat.Clone() - $Splat.EnableSiteCostedReferrals = -not $Splat.EnableSiteCostedReferrals - Test-TargetResource @Splat | Should Be $False - } - It 'should call expected Mocks' { - Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 - } - } - - Context 'Namespace Server Configuration PreferLogonDC is different' { - It 'should return false' { - $Splat = $NamespaceServerConfigurationSplat.Clone() - $Splat.PreferLogonDC = -not $Splat.PreferLogonDC - Test-TargetResource @Splat | Should Be $False - } - It 'should call expected Mocks' { - Assert-MockCalled -commandName Get-DFSNServerConfiguration -Exactly 1 - } - } - Context 'Namespace Server Configuration SyncIntervalSec is different' { It 'should return false' { $Splat = $NamespaceServerConfigurationSplat.Clone() From 8a3c3f5a76a1cba9ccba97ddf523a982e840121a Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sun, 5 Jun 2016 20:53:38 +1200 Subject: [PATCH 11/13] Dummy commit to trigger rebuild --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55f7947..d77a6a3 100644 --- a/README.md +++ b/README.md @@ -381,7 +381,7 @@ This resource is used to configure DFS Namespace server settings. This is a sing * **IsSingleInstance**: Specifies if the resource is a single instance, the value must be 'Yes'. Required. * **LdapTimeoutSec**: Specifies a time-out value, in seconds, for Lightweight Directory Access Protocol (LDAP) requests for the DFS namespace server. Uint32. Optional. * **SyncIntervalSec**: This interval controls how often domain-based DFS namespace root servers and domain controllers connect to the PDC emulator to get updates of DFS namespace metadata. Uint32. Optional. -* **UseFQDN**: Indicates whether a DFS namespace server uses FQDNs in referrals. Boolean. Optional. +* **UseFQDN**: Indicates whether a DFS namespace server uses FQDNs in referrals. Boolean. Optional. ### Examples Create an AD Domain V2 based DFS namespace called departments in the domain contoso.com with a single root target on the computer fs_1. Two subfolders are defined with targets that direct to shares on servers fs_3 and fs_8. From 2e7efccfd12d1e4976a665325f19c26146060fbc Mon Sep 17 00:00:00 2001 From: Katie Keim Date: Wed, 22 Jun 2016 16:30:00 -0700 Subject: [PATCH 12/13] Added the new MS code of conduct --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3d585c8..eab489f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ The **xDFS** module contains DSC resources for configuring Distributed File System Replication and Namespaces. Currently in this version only Replication folders are supported. Namespaces will be supported in a future release. +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + ## Requirements * **Windows Management Framework 5.0**: Required because the PSDSCRunAsCredential DSC Resource parameter is needed. From 4816f8de2a56441f01e2465a404ee5c7c185767f Mon Sep 17 00:00:00 2001 From: Katie Keim Date: Wed, 29 Jun 2016 13:00:01 -0700 Subject: [PATCH 13/13] Releasing version 3.1.0.0 --- README.md | 2 ++ appveyor.yml | 4 ++-- xDFS.psd1 | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c82cff6..e0a8673 100644 --- a/README.md +++ b/README.md @@ -736,6 +736,8 @@ Start-DscConfiguration ` ## Versions ### Unreleased + +### 3.1.0.0 * MSFT_xDFSNamespaceServerConfiguration- resource added. * Corrected names of DFS Namespace sample files to indicate that they are setting Namespace roots and folders. * Removed Pester version from AppVeyor.yml. diff --git a/appveyor.yml b/appveyor.yml index 50039bb..0e393ba 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ # environment configuration # #---------------------------------# os: WMF 5 -version: 3.0.{build}.0 +version: 3.1.{build}.0 install: - cinst -y pester - git clone https://github.com/PowerShell/DscResource.Tests @@ -41,7 +41,7 @@ deploy_script: # Creating project artifact $stagingDirectory = (Resolve-Path ..).Path $manifest = Join-Path $pwd "xDFS.psd1" - (Get-Content $manifest -Raw).Replace("3.0.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest + (Get-Content $manifest -Raw).Replace("3.1.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest $zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip" Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath) diff --git a/xDFS.psd1 b/xDFS.psd1 index 53b0d5a..25deddf 100644 --- a/xDFS.psd1 +++ b/xDFS.psd1 @@ -4,7 +4,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '3.0.0.0' +ModuleVersion = '3.1.0.0' # ID used to uniquely identify this module GUID = '3bcb9c66-ea0b-4675-bd46-c390a382c388' @@ -96,7 +96,11 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - # ReleaseNotes = '' + ReleaseNotes = '* MSFT_xDFSNamespaceServerConfiguration- resource added. +* Corrected names of DFS Namespace sample files to indicate that they are setting Namespace roots and folders. +* Removed Pester version from AppVeyor.yml. + +' # External dependent modules of this module # ExternalModuleDependencies = '' @@ -112,3 +116,4 @@ PrivateData = @{ # DefaultCommandPrefix = '' } +