Skip to content

Commit cbb005b

Browse files
authored
Fix style formatting in PowerShell script files (#2077)
1 parent 8981035 commit cbb005b

File tree

40 files changed

+196
-167
lines changed

40 files changed

+196
-167
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4141
- Integration_Test_Resources_ReportingServices
4242
- Integration_Test_Resources_ReportingServices_dbatools
4343
- Update build script path in integration tests.
44+
- Fix style formatting in all PowerShell script files.
4445
- SqlSetup
4546
- Fixed issue with AddNode where cluster IP information was not being passed to
4647
setup.exe ([issue #1171](https://github.com/dsccommunity/SqlServerDsc/issues/1171)).

source/Classes/020.SqlAudit.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,15 @@ class SqlAudit : SqlResourceBase
395395
{
396396
# Look for file audit properties not in desired state
397397
$fileAuditProperty = $properties.Keys.Where({
398-
$_ -in @(
399-
'Path'
400-
'MaximumFiles'
401-
'MaximumFileSize'
402-
'MaximumFileSizeUnit'
403-
'MaximumRolloverFiles'
404-
'ReserveDiskSpace'
405-
)
406-
})
398+
$_ -in @(
399+
'Path'
400+
'MaximumFiles'
401+
'MaximumFileSize'
402+
'MaximumFileSizeUnit'
403+
'MaximumRolloverFiles'
404+
'ReserveDiskSpace'
405+
)
406+
})
407407

408408
# If a property was found, throw an exception.
409409
if ($fileAuditProperty.Count -gt 0)

source/Classes/020.SqlPermission.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ class SqlPermission : SqlResourceBase
354354
$serverObject = $this.GetServerObject()
355355

356356
$testSqlDscIsLoginParameters = @{
357-
ServerObject = $serverObject
358-
Name = $this.Name
357+
ServerObject = $serverObject
358+
Name = $this.Name
359359
}
360360

361361
# This will test wether the principal exist.

source/DSCResources/DSC_SqlAGDatabase/DSC_SqlAGDatabase.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function Get-TargetResource
159159
#>
160160
function Set-TargetResource
161161
{
162-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('AvoidThrowOutsideOfTry', '', Justification='Because the code throws based on an prior expression')]
162+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('AvoidThrowOutsideOfTry', '', Justification = 'Because the code throws based on an prior expression')]
163163
[CmdletBinding()]
164164
param
165165
(

source/DSCResources/DSC_SqlAgentAlert/DSC_SqlAgentAlert.psm1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function Set-TargetResource
297297

298298
function Test-TargetResource
299299
{
300-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='The command Connect-Sql is called when Get-TargetResource is called')]
300+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'The command Connect-Sql is called when Get-TargetResource is called')]
301301
[CmdletBinding()]
302302
[OutputType([System.Boolean])]
303303
param
@@ -347,15 +347,18 @@ function Test-TargetResource
347347

348348
if ($Ensure -eq 'Present')
349349
{
350-
$returnValue = Test-DscParameterState `
351-
-CurrentValues $getTargetResourceResult `
352-
-DesiredValues $PSBoundParameters `
353-
-ValuesToCheck @(
350+
$testDscParameterStateParameters = @{
351+
CurrentValues = $getTargetResourceResult
352+
DesiredValues = $PSBoundParameters
353+
ValuesToCheck = @(
354354
'Name'
355355
'Severity'
356356
'MessageId'
357-
) `
358-
-TurnOffTypeChecking
357+
)
358+
TurnOffTypeChecking = $true
359+
}
360+
361+
$returnValue = Test-DscParameterState @testDscParameterStateParameters
359362
}
360363
else
361364
{

source/DSCResources/DSC_SqlAgentFailsafe/DSC_SqlAgentFailsafe.psm1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function Set-TargetResource
228228
#>
229229
function Test-TargetResource
230230
{
231-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='The command Connect-Sql is called when Get-TargetResource is called')]
231+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'The command Connect-Sql is called when Get-TargetResource is called')]
232232
[CmdletBinding()]
233233
[OutputType([System.Boolean])]
234234
param
@@ -275,14 +275,17 @@ function Test-TargetResource
275275

276276
if ($Ensure -eq 'Present')
277277
{
278-
$returnValue = Test-DscParameterState `
279-
-CurrentValues $getTargetResourceResult `
280-
-DesiredValues $PSBoundParameters `
281-
-ValuesToCheck @(
278+
$testDscParameterStateParameters = @{
279+
CurrentValues = $getTargetResourceResult
280+
DesiredValues = $PSBoundParameters
281+
ValuesToCheck = @(
282282
'FailsafeOperator'
283283
'NotificationMethod'
284-
) `
285-
-TurnOffTypeChecking
284+
)
285+
TurnOffTypeChecking = $true
286+
}
287+
288+
$returnValue = Test-DscParameterState @testDscParameterStateParameters
286289
}
287290
else
288291
{

source/DSCResources/DSC_SqlAgentOperator/DSC_SqlAgentOperator.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function Set-TargetResource
257257
#>
258258
function Test-TargetResource
259259
{
260-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='The command Connect-Sql is called when Get-TargetResource is called')]
260+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'The command Connect-Sql is called when Get-TargetResource is called')]
261261
[CmdletBinding()]
262262
[OutputType([System.Boolean])]
263263
param

source/DSCResources/DSC_SqlAlias/DSC_SqlAlias.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US'
1515
#>
1616
function Get-TargetResource
1717
{
18-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='Neither command is needed for this resource since the resource modifies registry')]
18+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'Neither command is needed for this resource since the resource modifies registry')]
1919
[CmdletBinding()]
2020
[OutputType([System.Collections.Hashtable])]
2121
param
@@ -133,7 +133,7 @@ function Get-TargetResource
133133
#>
134134
function Set-TargetResource
135135
{
136-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='Neither command is needed for this resource since the resource modifies registry')]
136+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'Neither command is needed for this resource since the resource modifies registry')]
137137
[CmdletBinding()]
138138
param
139139
(
@@ -265,7 +265,7 @@ function Set-TargetResource
265265
#>
266266
function Test-TargetResource
267267
{
268-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='Neither command is needed for this resource since the resource modifies registry')]
268+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'Neither command is needed for this resource since the resource modifies registry')]
269269
[CmdletBinding()]
270270
[OutputType([System.Boolean])]
271271
param

source/DSCResources/DSC_SqlAlwaysOnService/DSC_SqlAlwaysOnService.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function Set-TargetResource
128128
)
129129

130130
# Build the instance name to allow the Enable/Disable-Always On to connect to the instance
131-
if ($InstanceName -eq "MSSQLSERVER")
131+
if ($InstanceName -eq 'MSSQLSERVER')
132132
{
133133
$serverInstance = $ServerName
134134
}
@@ -206,7 +206,7 @@ function Set-TargetResource
206206
#>
207207
function Test-TargetResource
208208
{
209-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='The command Connect-Sql is called when Get-TargetResource is called')]
209+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'The command Connect-Sql is called when Get-TargetResource is called')]
210210
[CmdletBinding()]
211211
[OutputType([System.Boolean])]
212212
param

source/DSCResources/DSC_SqlConfiguration/DSC_SqlConfiguration.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function Set-TargetResource
219219
#>
220220
function Test-TargetResource
221221
{
222-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification='The command Connect-Sql is called when Get-TargetResource is called')]
222+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO', '', Justification = 'The command Connect-Sql is called when Get-TargetResource is called')]
223223
[CmdletBinding()]
224224
[OutputType([System.Boolean])]
225225
param

0 commit comments

Comments
 (0)