Skip to content

Commit

Permalink
Changes to SqlServerReplication
Browse files Browse the repository at this point in the history
- Added en-US localization (issue dsccommunity#620).
  • Loading branch information
johlju committed Apr 22, 2019
1 parent 7a05776 commit 146244c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
`Start-DscConfiguration -Verbose`.
- Changes to SqlSetup
- Concatenated Robocopy localization strings ([issue #694](https://github.com/PowerShell/SqlServerDsc/issues/694)).
- Changes to SqlServerReplication
- Added en-US localization ([issue #620](https://github.com/PowerShell/SqlServerDsc/issues/620)).

## 12.4.0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules'

$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'DscResource.LocalizationHelper'
Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'DscResource.LocalizationHelper.psm1')

$script:resourceHelperModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'DscResource.Common'
Import-Module -Name (Join-Path -Path $script:resourceHelperModulePath -ChildPath 'DscResource.Common.psm1')

$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_SqlRSSetup'

$dom = [AppDomain]::CreateDomain('SqlServerReplication')

function Get-TargetResource
Expand Down Expand Up @@ -44,6 +55,10 @@ function Get-TargetResource
$UninstallWithForce = $true
)

Write-Verbose -Message (
$script:localizedData.GetCurrentState -f $InstanceName
)

$Ensure = 'Absent'

$sqlMajorVersion = Get-SqlServerMajorVersion -InstanceName $InstanceName
Expand All @@ -63,6 +78,19 @@ function Get-TargetResource
$DistributorMode = 'Remote'
}

if ($DistributorMode)
{
Write-Verbose -Message (
$script:localizedData.DistributorMode -f $DistributorMode, $InstanceName
)
}
else
{
Write-Verbose -Message (
$script:localizedData.NoDistributorMode -f $InstanceName
)
}

if ($Ensure -eq 'Present')
{
$DistributionDBName = $localReplicationServer.DistributionDatabase
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ConvertFrom-StringData @'
GetCurrentState = Get the current state of the server replication configuration for the instance '{0}'.
DistributorMode = The distributor mode is currently '{0}' for the instance '{1}'.
NoDistributorMode = There are currently no distributor mode set for the instance '{1}'.
TestingConfiguration = Determines if the Microsoft SQL Server Reporting Service instance is installed.
'@

0 comments on commit 146244c

Please sign in to comment.