Skip to content

Commit cac3a45

Browse files
committed
Fix files with UTF8 BOM
1 parent 7bf9507 commit cac3a45

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

DSCResources/CommonResourceHelper.psm1

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<#
1+
<#
22
.SYNOPSIS
33
Retrieves the localized string data based on the machine's culture.
44
Falls back to en-US strings if the machine's culture is not supported.
@@ -87,25 +87,25 @@ function Test-DscParameterState
8787
[CmdletBinding()]
8888
param
8989
(
90-
[Parameter(Mandatory = $true)]
90+
[Parameter(Mandatory = $true)]
9191
[hashtable]
9292
$CurrentValues,
9393

94-
[Parameter(Mandatory = $true)]
94+
[Parameter(Mandatory = $true)]
9595
[object]
9696
$DesiredValues,
97-
97+
9898
[string[]]
9999
$ValuesToCheck,
100-
100+
101101
[switch]
102102
$TurnOffTypeChecking
103103
)
104104

105105
$returnValue = $true
106106

107107
$types = 'System.Management.Automation.PSBoundParametersDictionary', 'System.Collections.Hashtable', 'Microsoft.Management.Infrastructure.CimInstance'
108-
108+
109109
if ($DesiredValues.GetType().FullName -notin $types)
110110
{
111111
throw ("Property 'DesiredValues' in Test-DscParameterState must be either a Hashtable or CimInstance. Type detected was $($DesiredValues.GetType().FullName)")
@@ -115,13 +115,13 @@ function Test-DscParameterState
115115
{
116116
throw ("If 'DesiredValues' is a CimInstance then property 'ValuesToCheck' must contain a value")
117117
}
118-
118+
119119
$desiredValuesClean = Remove-CommonParameter -Hashtable $DesiredValues
120120

121121
if (-not $ValuesToCheck)
122122
{
123123
$keyList = $desiredValuesClean.Keys
124-
}
124+
}
125125
else
126126
{
127127
$keyList = $ValuesToCheck
@@ -135,19 +135,19 @@ function Test-DscParameterState
135135
}
136136
else
137137
{
138-
$desiredType = [psobject]@{
139-
Name = 'Unknown'
138+
$desiredType = [psobject]@{
139+
Name = 'Unknown'
140140
}
141141
}
142-
142+
143143
if ($null -ne $CurrentValues.$key)
144144
{
145145
$currentType = $CurrentValues.$key.GetType()
146146
}
147147
else
148148
{
149-
$currentType = [psobject]@{
150-
Name = 'Unknown'
149+
$currentType = [psobject]@{
150+
Name = 'Unknown'
151151
}
152152
}
153153

@@ -164,7 +164,7 @@ function Test-DscParameterState
164164
Write-Verbose -Message ('NOTMATCH: PSCredential username mismatch. Current state is {0} and desired state is {1}' -f $CurrentValues.$key.UserName, $desiredValuesClean.$key.UserName)
165165
$returnValue = $false
166166
}
167-
167+
168168
# Assume the string is our username when the matching desired value is actually a credential
169169
if ($currentType.Name -eq 'string' -and $CurrentValues.$key -eq $desiredValuesClean.$key.UserName)
170170
{
@@ -177,10 +177,10 @@ function Test-DscParameterState
177177
$returnValue = $false
178178
}
179179
}
180-
180+
181181
if (-not $TurnOffTypeChecking)
182-
{
183-
if (($desiredType.Name -ne 'Unknown' -and $currentType.Name -ne 'Unknown') -and
182+
{
183+
if (($desiredType.Name -ne 'Unknown' -and $currentType.Name -ne 'Unknown') -and
184184
$desiredType.FullName -ne $currentType.FullName)
185185
{
186186
Write-Verbose -Message "NOTMATCH: Type mismatch for property '$key' Current state type is '$($currentType.Name)' and desired type is '$($desiredType.Name)'"
@@ -193,22 +193,22 @@ function Test-DscParameterState
193193
Write-Verbose -Message "MATCH: Value (type $($desiredType.Name)) for property '$key' does match. Current state is '$($CurrentValues.$key)' and desired state is '$($desiredValuesClean.$key)'"
194194
continue
195195
}
196-
196+
197197
if ($desiredValuesClean.GetType().Name -in 'HashTable', 'PSBoundParametersDictionary')
198198
{
199199
$checkDesiredValue = $desiredValuesClean.ContainsKey($key)
200-
}
200+
}
201201
else
202202
{
203203
$checkDesiredValue = Test-DSCObjectHasProperty -Object $desiredValuesClean -PropertyName $key
204204
}
205-
205+
206206
if (-not $checkDesiredValue)
207207
{
208208
Write-Verbose -Message "MATCH: Value (type $($desiredType.Name)) for property '$key' does match. Current state is '$($CurrentValues.$key)' and desired state is '$($desiredValuesClean.$key)'"
209209
continue
210210
}
211-
211+
212212
if ($desiredType.IsArray)
213213
{
214214
Write-Verbose -Message "Comparing values in property '$key'"
@@ -237,33 +237,33 @@ function Test-DscParameterState
237237
}
238238
else
239239
{
240-
$desiredType = [psobject]@{
240+
$desiredType = [psobject]@{
241241
Name = 'Unknown'
242242
}
243243
}
244-
244+
245245
if ($null -ne $currentArrayValues[$i])
246246
{
247247
$currentType = $currentArrayValues[$i].GetType()
248248
}
249249
else
250250
{
251251
$currentType = [psobject]@{
252-
Name = 'Unknown'
252+
Name = 'Unknown'
253253
}
254254
}
255-
255+
256256
if (-not $TurnOffTypeChecking)
257257
{
258-
if (($desiredType.Name -ne 'Unknown' -and $currentType.Name -ne 'Unknown') -and
258+
if (($desiredType.Name -ne 'Unknown' -and $currentType.Name -ne 'Unknown') -and
259259
$desiredType.FullName -ne $currentType.FullName)
260260
{
261261
Write-Verbose -Message "`tNOTMATCH: Type mismatch for property '$key' Current state type of element [$i] is '$($currentType.Name)' and desired type is '$($desiredType.Name)'"
262262
$returnValue = $false
263263
continue
264264
}
265265
}
266-
266+
267267
if ($desiredArrayValues[$i] -ne $currentArrayValues[$i])
268268
{
269269
Write-Verbose -Message "`tNOTMATCH: Value [$i] (type $($desiredType.Name)) for property '$key' does match. Current state is '$($currentArrayValues[$i])' and desired state is '$($desiredArrayValues[$i])'"
@@ -276,20 +276,20 @@ function Test-DscParameterState
276276
continue
277277
}
278278
}
279-
279+
280280
}
281-
}
282-
else
281+
}
282+
else
283283
{
284284
if ($desiredValuesClean.$key -ne $CurrentValues.$key)
285285
{
286286
Write-Verbose -Message "NOTMATCH: Value (type $($desiredType.Name)) for property '$key' does not match. Current state is '$($CurrentValues.$key)' and desired state is '$($desiredValuesClean.$key)'"
287287
$returnValue = $false
288288
}
289-
290-
}
289+
290+
}
291291
}
292-
292+
293293
Write-Verbose -Message "Result is '$returnValue'"
294294
return $returnValue
295295
}
@@ -308,7 +308,7 @@ function Test-DSCObjectHasProperty
308308
[OutputType([bool])]
309309
param
310310
(
311-
[Parameter(Mandatory = $true)]
311+
[Parameter(Mandatory = $true)]
312312
[object]
313313
$Object,
314314

@@ -317,11 +317,11 @@ function Test-DSCObjectHasProperty
317317
$PropertyName
318318
)
319319

320-
if ($Object.PSObject.Properties.Name -contains $PropertyName)
320+
if ($Object.PSObject.Properties.Name -contains $PropertyName)
321321
{
322322
return [bool] $Object.$PropertyName
323323
}
324-
324+
325325
return $false
326326
}
327327

Tests/Unit/MSFT_xComputer.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$Global:DSCModuleName = 'xComputerManagement'
1+
$Global:DSCModuleName = 'xComputerManagement'
22
$Global:DSCResourceName = 'MSFT_xComputer'
33

44
#region HEADER
@@ -16,7 +16,7 @@ Import-Module (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests\TestHel
1616
$TestEnvironment = Initialize-TestEnvironment `
1717
-DSCModuleName $Global:DSCModuleName `
1818
-DSCResourceName $Global:DSCResourceName `
19-
-TestType Unit
19+
-TestType Unit
2020
#endregion
2121

2222
# Begin Testing
@@ -31,7 +31,7 @@ try
3131
$SecPassword = New-Object -Type SecureString
3232
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'USER',$SecPassword
3333
$NotComputerName = if($env:COMPUTERNAME -ne 'othername'){'othername'}else{'name'}
34-
34+
3535
Context "$($Global:DSCResourceName)\Test-TargetResource" {
3636
Mock Get-WMIObject {[PSCustomObject]@{DomainName = 'ContosoLtd'}} -ParameterFilter {$Class -eq 'Win32_NTDomain'}
3737
It 'Throws if both DomainName and WorkGroupName are specified' {
@@ -121,7 +121,7 @@ try
121121
It 'Should not Throw if name is localhost' {
122122
{Test-TargetResource -Name "localhost"} | Should Not Throw
123123
}
124-
124+
125125
}
126126
Context "$($Global:DSCResourceName)\Get-TargetResource" {
127127
It 'should not throw' {

0 commit comments

Comments
 (0)