Skip to content

Commit 1228c8a

Browse files
committed
Fixed the small descrepancies in the PR
1 parent aff25a7 commit 1228c8a

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

DSCResources/DSR_ReplaceText/DSR_ReplaceText.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ function Assert-ParametersValid
357357
#>
358358
function Add-ConfigurationEntry
359359
{
360+
[OutputType([String])]
361+
[CmdletBinding()]
360362
param
361363
(
362364
[Parameter()]
@@ -368,13 +370,13 @@ function Add-ConfigurationEntry
368370
$Text
369371
)
370372

371-
$stringBuilder = New-Object System.Text.StringBuilder
373+
$stringBuilder = New-Object -TypeName System.Text.StringBuilder
372374

373375
$fileContentArray = $FileContent.Trim() -split '\n'
374376

375377
foreach ($line in $fileContentArray)
376378
{
377-
$null = $stringBuilder.AppendLine($line.Trim())
379+
$null = $stringBuilder.AppendLine($line)
378380
}
379381

380382
$null = $stringBuilder.AppendLine($Text)

Tests/Unit/DSR_ReplaceText.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Setting3.Test=Value4
217217
}
218218
}
219219

220-
Context 'File exists and search text can not be found'{
220+
Context 'File exists and search text can not be found' {
221221
# verifiable (should be called) mocks
222222
Mock `
223223
-CommandName Assert-ParametersValid `
@@ -400,7 +400,7 @@ Setting3.Test=Value4
400400
} | Should -Not -Throw
401401
}
402402

403-
It 'Should return true' {
403+
It 'Should return false' {
404404
$script:result | Should -Be $false
405405
}
406406

Tests/Unit/TestFile.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)