@@ -19,7 +19,7 @@ Describe "Test available parameters" {
1919 It " has a Path parameter" {
2020 $params.ContainsKey (" Path" ) | Should Be $true
2121 }
22-
22+
2323 It " accepts string" {
2424 $params [" Path" ].ParameterType.FullName | Should Be " System.String"
2525 }
@@ -29,8 +29,8 @@ Describe "Test available parameters" {
2929 It " has a ScriptDefinition parameter" {
3030 $params.ContainsKey (" ScriptDefinition" ) | Should Be $true
3131 }
32-
33- It " accepts string" {
32+
33+ It " accepts string" {
3434 $params [" ScriptDefinition" ].ParameterType.FullName | Should Be " System.String"
3535 }
3636 }
@@ -69,6 +69,16 @@ Describe "Test available parameters" {
6969 }
7070 }
7171
72+ Context " SaveDSCResourceDependency parameter" {
73+ It " has the parameter" {
74+ $params.ContainsKey (" SaveDscResourceDependency" ) | Should Be $true
75+ }
76+
77+ It " is a switch parameter" {
78+ $params [" SaveDscResourceDependency" ].ParameterType.FullName | Should Be " System.Management.Automation.SwitchParameter"
79+ }
80+ }
81+
7282 Context " It has 2 parameter sets: File and ScriptDefinition" {
7383 It " Has 2 parameter sets" {
7484 $sa.ParameterSets.Count | Should Be 2
@@ -144,14 +154,14 @@ Describe "Test Path" {
144154 if (! $testingLibraryUsage )
145155 {
146156 # There is probably a more concise way to do this but for now we will settle for this!
147- Function GetFreeDrive ($freeDriveLen ) {
157+ Function GetFreeDrive ($freeDriveLen ) {
148158 $ordA = 65
149159 $ordZ = 90
150160 $freeDrive = " "
151161 $freeDriveName = " "
152162 do {
153163 $freeDriveName = (1 .. $freeDriveLen | % {[char ](Get-Random - Maximum $ordZ - Minimum $ordA )}) -join ' '
154- $freeDrive = $freeDriveName + " :"
164+ $freeDrive = $freeDriveName + " :"
155165 }while (Test-Path $freeDrive )
156166 $freeDrive , $freeDriveName
157167 }
@@ -180,7 +190,7 @@ Describe "Test Path" {
180190 Context " When given a directory" {
181191 $withoutPathWithDirectory = Invoke-ScriptAnalyzer - Recurse $directory \RecursionDirectoryTest
182192 $withPathWithDirectory = Invoke-ScriptAnalyzer - Recurse - Path $directory \RecursionDirectoryTest
183-
193+
184194 It " Has the same count as without Path parameter" {
185195 $withoutPathWithDirectory.Count -eq $withPathWithDirectory.Count | Should Be $true
186196 }
@@ -206,7 +216,7 @@ Describe "Test ExcludeRule" {
206216
207217 It " excludes 3 rules" {
208218 $noViolations = Invoke-ScriptAnalyzer $directory \..\Rules\BadCmdlet.ps1 - ExcludeRule $rules | Where-Object {$rules -contains $_.RuleName }
209- $noViolations.Count | Should Be 0
219+ $noViolations.Count | Should Be 0
210220 }
211221 }
212222
@@ -329,23 +339,23 @@ Describe "Test CustomizedRulePath" {
329339 It " When supplied with a collection of paths" {
330340 $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomRulePath (" $directory \CommunityAnalyzerRules" , " $directory \SampleRule" , " $directory \SampleRule\SampleRule2" )
331341 $customizedRulePath.Count | Should Be 3
332- }
342+ }
333343
334344 }
335345
336346
337347 Context " When used incorrectly" {
338- It " file cannot be found" {
348+ It " file cannot be found" {
339349 try
340350 {
341351 Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomRulePath " Invalid CustomRulePath"
342352 }
343353 catch
344354 {
345355 if (-not $testingLibraryUsage )
346- {
347- $Error [0 ].FullyQualifiedErrorId | should match " PathNotFound,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand"
348- }
356+ {
357+ $Error [0 ].FullyQualifiedErrorId | should match " PathNotFound,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand"
358+ }
349359 }
350360 }
351361 }
0 commit comments