diff --git a/CHANGELOG.md b/CHANGELOG.md index ea3cbfc62..dfa21d99c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ `Invoke-SqlScript` so that `PRINT` statements is outputted correctly when verbose output is requested, e.g `Start-DscConfiguration -Verbose`. + - Added en-US localization. - Changes to SqlSetup - Concatenated Robocopy localization strings ([issue #694](https://github.com/PowerShell/SqlServerDsc/issues/694)). - Changes to SqlWaitForAG diff --git a/DSCResources/MSFT_SqlScriptQuery/MSFT_SqlScriptQuery.psm1 b/DSCResources/MSFT_SqlScriptQuery/MSFT_SqlScriptQuery.psm1 index 709b4ec16..0a55000d1 100644 --- a/DSCResources/MSFT_SqlScriptQuery/MSFT_SqlScriptQuery.psm1 +++ b/DSCResources/MSFT_SqlScriptQuery/MSFT_SqlScriptQuery.psm1 @@ -7,6 +7,8 @@ Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath ' $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_SqlScriptQuery' + <# .SYNOPSIS Returns the current state of the SQL Server features. @@ -80,6 +82,10 @@ function Get-TargetResource $Variable ) + Write-Verbose -Message ( + $script:localizedData.ExecutingGetQuery -f $ServerInstance + ) + $invokeParameters = @{ Query = $GetQuery ServerInstance = $ServerInstance @@ -177,6 +183,10 @@ function Set-TargetResource $Variable ) + Write-Verbose -Message ( + $script:localizedData.ExecutingSetQuery -f $ServerInstance + ) + $invokeParameters = @{ Query = $SetQuery ServerInstance = $ServerInstance @@ -261,8 +271,16 @@ function Test-TargetResource $Variable ) + Write-Verbose -Message ( + $script:localizedData.TestingConfiguration + ) + try { + Write-Verbose -Message ( + $script:localizedData.ExecutingTestQuery -f $ServerInstance + ) + $invokeParameters = @{ Query = $TestQuery ServerInstance = $ServerInstance @@ -277,10 +295,18 @@ function Test-TargetResource if ($null -eq $result) { + Write-Verbose -Message ( + $script:localizedData.InDesiredState + ) + return $true } else { + Write-Verbose -Message ( + $script:localizedData.NotInDesiredState + ) + return $false } } diff --git a/DSCResources/MSFT_SqlScriptQuery/en-US/MSFT_SqlScriptQuery.strings.psd1 b/DSCResources/MSFT_SqlScriptQuery/en-US/MSFT_SqlScriptQuery.strings.psd1 new file mode 100644 index 000000000..ad7e4b85c --- /dev/null +++ b/DSCResources/MSFT_SqlScriptQuery/en-US/MSFT_SqlScriptQuery.strings.psd1 @@ -0,0 +1,10 @@ +# Localized resources for SqlSetup + +ConvertFrom-StringData @' + ExecutingGetQuery = Executing the Get query on the instance '{0}'. + ExecutingSetQuery = Executing the Set query on the instance '{0}'. + ExecutingTestQuery = Executing the Test query on the instance '{0}'. + TestingConfiguration = Determines if the configuration in the Set query is in desired state. + InDesiredState = The configuration is in desired state. + NotInDesiredState = The configuration is not in desired state. +'@