From 7a70c0328ca9580ea710692f70b2e3f06fa13297 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 9 Sep 2019 19:42:39 +0200 Subject: [PATCH] SqlServerDsc: Fix keywords to lower-case to align with guideline (#1425) - Changes to SqlServerDsc - Fix keywords to lower-case to align with guideline. --- CHANGELOG.md | 3 +++ DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1 | 4 ++-- DSCResources/MSFT_SqlAGReplica/MSFT_SqlAGReplica.psm1 | 4 ++-- .../MSFT_SqlDatabaseDefaultLocation.psm1 | 4 ++-- Tests/TestHelpers/CommonTestHelper.psm1 | 2 +- Tests/Unit/MSFT_SqlAGReplica.Tests.ps1 | 8 ++++---- Tests/Unit/MSFT_SqlScriptQuery.Tests.ps1 | 2 +- Tests/Unit/SqlServerDsc.Common.Tests.ps1 | 4 ++-- Tests/Unit/Stubs/Write-ModuleStubFile.ps1 | 2 +- 9 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f75440be..f7ed7c616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Changes to SqlServerDsc + - Fix keywords to lower-case to align with guideline. + ## 13.1.0.0 - Changes to SqlServerDsc diff --git a/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1 b/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1 index 14b8d705a..719055924 100644 --- a/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1 +++ b/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1 @@ -158,7 +158,7 @@ function Get-TargetResource function Set-TargetResource { [CmdletBinding()] - Param + param ( [Parameter(Mandatory = $true)] [System.String] @@ -560,7 +560,7 @@ function Test-TargetResource { [CmdletBinding()] [OutputType([System.Boolean])] - Param + param ( [Parameter(Mandatory = $true)] [System.String] diff --git a/DSCResources/MSFT_SqlAGReplica/MSFT_SqlAGReplica.psm1 b/DSCResources/MSFT_SqlAGReplica/MSFT_SqlAGReplica.psm1 index e2980e8fd..88c865464 100644 --- a/DSCResources/MSFT_SqlAGReplica/MSFT_SqlAGReplica.psm1 +++ b/DSCResources/MSFT_SqlAGReplica/MSFT_SqlAGReplica.psm1 @@ -169,7 +169,7 @@ function Get-TargetResource function Set-TargetResource { [CmdletBinding()] - Param + param ( [Parameter(Mandatory = $true)] [System.String] @@ -552,7 +552,7 @@ function Test-TargetResource { [CmdletBinding()] [OutputType([System.Boolean])] - Param + param ( [Parameter(Mandatory = $true)] [System.String] diff --git a/DSCResources/MSFT_SqlDatabaseDefaultLocation/MSFT_SqlDatabaseDefaultLocation.psm1 b/DSCResources/MSFT_SqlDatabaseDefaultLocation/MSFT_SqlDatabaseDefaultLocation.psm1 index 76e7b4a53..75b743675 100644 --- a/DSCResources/MSFT_SqlDatabaseDefaultLocation/MSFT_SqlDatabaseDefaultLocation.psm1 +++ b/DSCResources/MSFT_SqlDatabaseDefaultLocation/MSFT_SqlDatabaseDefaultLocation.psm1 @@ -23,7 +23,7 @@ $script:localizedData = Get-LocalizedData -ResourceName 'MSFT_SqlDatabaseDefault The path to the default directory to be configured. Not used in Get-TargetResource #> -Function Get-TargetResource +function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] @@ -110,7 +110,7 @@ Function Get-TargetResource Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server Instance. Not used in Set-TargetResource. #> -Function Set-TargetResource +function Set-TargetResource { [CmdletBinding()] param diff --git a/Tests/TestHelpers/CommonTestHelper.psm1 b/Tests/TestHelpers/CommonTestHelper.psm1 index 6eee6a16a..41d532cf4 100644 --- a/Tests/TestHelpers/CommonTestHelper.psm1 +++ b/Tests/TestHelpers/CommonTestHelper.psm1 @@ -178,7 +178,7 @@ function Remove-IntegrationLoopbackAdapter #> function Get-NetIPAddressNetwork { - Param + param ( [Parameter(Mandatory = $true)] [IPAddress] diff --git a/Tests/Unit/MSFT_SqlAGReplica.Tests.ps1 b/Tests/Unit/MSFT_SqlAGReplica.Tests.ps1 index 09f547520..2992896dd 100644 --- a/Tests/Unit/MSFT_SqlAGReplica.Tests.ps1 +++ b/Tests/Unit/MSFT_SqlAGReplica.Tests.ps1 @@ -187,7 +187,7 @@ try #region Function mocks $mockConnectSqlServer1 = { - Param + param ( [Parameter()] [System.String] @@ -290,7 +290,7 @@ try } $mockConnectSqlServer2 = { - Param + param ( [Parameter()] [System.String] @@ -410,7 +410,7 @@ try } $mockConnectSqlServer3 = { - Param + param ( [Parameter()] [System.String] @@ -533,7 +533,7 @@ try $mockAvailabilityGroupReplicaPropertyValue = '' # Set dynamically during runtime $mockUpdateAvailabilityGroupReplica = { - Param + param ( [Parameter()] [Microsoft.SqlServer.Management.Smo.AvailabilityReplica] diff --git a/Tests/Unit/MSFT_SqlScriptQuery.Tests.ps1 b/Tests/Unit/MSFT_SqlScriptQuery.Tests.ps1 index 8c3fd3d7b..dd7447589 100644 --- a/Tests/Unit/MSFT_SqlScriptQuery.Tests.ps1 +++ b/Tests/Unit/MSFT_SqlScriptQuery.Tests.ps1 @@ -10,7 +10,7 @@ # Suppression of this PSSA rule allowed in tests. [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] -Param() +param () Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1') diff --git a/Tests/Unit/SqlServerDsc.Common.Tests.ps1 b/Tests/Unit/SqlServerDsc.Common.Tests.ps1 index 14d4a8a13..482697f2e 100644 --- a/Tests/Unit/SqlServerDsc.Common.Tests.ps1 +++ b/Tests/Unit/SqlServerDsc.Common.Tests.ps1 @@ -2128,7 +2128,7 @@ InModuleScope 'SqlServerDsc.Common' { } $mockConnectSql = { - Param + param ( [Parameter()] [System.String] @@ -2195,7 +2195,7 @@ InModuleScope 'SqlServerDsc.Common' { BeforeEach { $mockSqlVersion = 13 $mockConnectSql = { - Param + param ( [Parameter()] [System.String] diff --git a/Tests/Unit/Stubs/Write-ModuleStubFile.ps1 b/Tests/Unit/Stubs/Write-ModuleStubFile.ps1 index b41ed803b..101124e22 100644 --- a/Tests/Unit/Stubs/Write-ModuleStubFile.ps1 +++ b/Tests/Unit/Stubs/Write-ModuleStubFile.ps1 @@ -126,7 +126,7 @@ function Write-ModuleStubFile $endOfParameter = $true } - # Format Param line + # Format param line 'param\($' { $line = $line -replace 'param\(','param'