diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b777f6..6344c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,8 @@ - Replaced the URL for the parameter Role in README.md. The new URL is a more generic description of the possible settings for the Role parameter. The previous URL was still correct but focused on Hyper-V in particular. - - Fixed typos in parameter descriptions in README.md. + - Fixed typos in parameter descriptions in README.md, comment-based help and schema.mof. + - Enabled localization for all strings ([issue #85](https://github.com/PowerShell/xFailOverCluster/issues/85)). - Changes to xCluster - Resolved Script Analyzer rule warnings by changing Get-WmiObject to Get-CimInstance ([issue #49](https://github.com/PowerShell/xFailOverCluster/issues/49)). diff --git a/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.psm1 b/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.psm1 index fd43531..60781f6 100644 --- a/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.psm1 +++ b/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.psm1 @@ -1,12 +1,17 @@ +Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) ` + -ChildPath 'CommonResourceHelper.psm1') + +$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xClusterNetwork' + <# .SYNOPSIS Returns the current state of the failover cluster network resource. .PARAMETER Address - The adress for the cluster network in the format '10.0.0.0'. + The address for the cluster network in the format '10.0.0.0'. .PARAMETER AddressMask - The adress mask for the cluster network in the format '255.255.255.0'. + The address mask for the cluster network in the format '255.255.255.0'. #> function Get-TargetResource { @@ -42,10 +47,10 @@ function Get-TargetResource network resource. .PARAMETER Address - The adress for the cluster network in the format '10.0.0.0'. + The address for the cluster network in the format '10.0.0.0'. .PARAMETER AddressMask - The adress mask for the cluster network in the format '255.255.255.0'. + The address mask for the cluster network in the format '255.255.255.0'. .PARAMETER Name The name of the cluster network. If the cluster network name is not in @@ -100,7 +105,7 @@ function Set-TargetResource if ($PSBoundParameters.ContainsKey('Name') -and $getTargetResourceResult.Name -ne $Name) { - Write-Verbose "Changing the name of network $Address/$AddressMask to '$Name'" + Write-Verbose -Message ($script:localizedData.ChangeNetworkName -f $Address, $AddressMask, $Name) $clusterNetworkResource = Get-ClusterNetwork | Where-Object -FilterScript { $_.Address -eq $Address -and $_.AddressMask -eq $AddressMask @@ -111,7 +116,7 @@ function Set-TargetResource if ($PSBoundParameters.ContainsKey('Role') -and $getTargetResourceResult.Role -ne $Role) { - Write-Verbose "Changing the role of network $Address/$AddressMask to '$Role'" + Write-Verbose -Message ($script:localizedData.ChangeNetworkName -f $Address, $AddressMask, $Role) $clusterNetworkResource = Get-ClusterNetwork | Where-Object -FilterScript { $_.Address -eq $Address -and $_.AddressMask -eq $AddressMask @@ -122,7 +127,7 @@ function Set-TargetResource if ($PSBoundParameters.ContainsKey('Metric') -and $getTargetResourceResult.Metric -ne $Metric) { - Write-Verbose "Changing the metric of network $Address/$AddressMask to '$Metric'" + Write-Verbose -Message ($script:localizedData.ChangeNetworkName -f $Address, $AddressMask, $Metric) $clusterNetworkResource = Get-ClusterNetwork | Where-Object -FilterScript { $_.Address -eq $Address -and $_.AddressMask -eq $AddressMask @@ -138,10 +143,10 @@ function Set-TargetResource values for the properties Name, Role and Metric. .PARAMETER Address - The adress for the cluster network in the format '10.0.0.0'. + The address for the cluster network in the format '10.0.0.0'. .PARAMETER AddressMask - The adress mask for the cluster network in the format '255.255.255.0'. + The address mask for the cluster network in the format '255.255.255.0'. .PARAMETER Name The name of the cluster network. If the cluster network name is not in diff --git a/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.schema.mof b/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.schema.mof index 3699b96..63945b7 100644 --- a/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.schema.mof +++ b/DSCResources/MSFT_xClusterNetwork/MSFT_xClusterNetwork.schema.mof @@ -1,8 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("xClusterNetwork")] class MSFT_xClusterNetwork : OMI_BaseResource { - [Key, Description("The adress for the cluster network in the format '10.0.0.0'.")] String Address; - [Key, Description("The adress mask for the cluster network in the format '255.255.255.0'.")] String AddressMask; + [Key, Description("The address for the cluster network in the format '10.0.0.0'.")] String Address; + [Key, Description("The address mask for the cluster network in the format '255.255.255.0'.")] String AddressMask; [Write, Description("The name of the cluster network. If the cluster network name is not in desired state it will be renamed to match this name.")] String Name; [Write, Description("he role of the cluster network. If the cluster network role is not in desired state it will change to match this role."), ValueMap{"0","1","3"}, Values{"0","1","3"}] String Role; [Write, Description("The metric number for the cluster network. If the cluster network metric number is not in desired state it will be changed to match this metric number.")] String Metric; diff --git a/DSCResources/MSFT_xClusterNetwork/en-US/MSFT_xClusterNetwork.strings.psd1 b/DSCResources/MSFT_xClusterNetwork/en-US/MSFT_xClusterNetwork.strings.psd1 new file mode 100644 index 0000000..6341410 --- /dev/null +++ b/DSCResources/MSFT_xClusterNetwork/en-US/MSFT_xClusterNetwork.strings.psd1 @@ -0,0 +1,7 @@ +# Localized resources for xClusterNetwork + +ConvertFrom-StringData @' + ChangeNetworkName = Changing the name of the network {0}/{1} to '{2}'. + ChangeNetworkRole = Changing the role of the network {0}/{1} to '{2}'. + ChangeNetworkMetric = Changing the metric of the network {0}/{1} to '{2}'. +'@