@@ -133,7 +133,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
133133
134134 Context ' When passing SilentlyContinue to ErrorAction' {
135135 It ' Should not throw ' {
136- { Set-SqlDscStartupParameter - ServerName ' localhost' - TraceFlag @ () - ErrorAction ' SilentlyContinue' } | Should -Not - Throw
136+ $null = Set-SqlDscStartupParameter - ServerName ' localhost' - TraceFlag @ () - ErrorAction ' SilentlyContinue'
137137
138138 Should - Invoke - CommandName Get-SqlDscManagedComputerService - Exactly - Times 1 - Scope It
139139 }
@@ -175,7 +175,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
175175
176176 Context ' When using parameter Confirm with value $false' {
177177 It ' Should call the mocked method and have correct value in the object' {
178- { Set-SqlDscStartupParameter - ServiceObject $mockServiceObject - TraceFlag 4199 - Confirm:$false } | Should -Not - Throw
178+ $null = Set-SqlDscStartupParameter - ServiceObject $mockServiceObject - TraceFlag 4199 - Confirm:$false
179179
180180 # This is the object created by the mock and modified by the command.
181181 $mockServiceObject.StartupParameters | Should - BeExactly ($mockStartupParameters + ' ;-T4199' )
@@ -186,7 +186,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
186186
187187 Context ' When using parameter Force' {
188188 It ' Should call the mocked method and have correct value in the object' {
189- { Set-SqlDscStartupParameter - ServiceObject $mockServiceObject - TraceFlag 4199 - Force } | Should -Not - Throw
189+ $null = Set-SqlDscStartupParameter - ServiceObject $mockServiceObject - TraceFlag 4199 - Force
190190
191191 # This is the object created by the mock and modified by the command.
192192 $mockServiceObject.StartupParameters | Should - BeExactly ($mockStartupParameters + ' ;-T4199' )
@@ -197,7 +197,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
197197
198198 Context ' When using parameter WhatIf' {
199199 It ' Should not call the mocked method and should not have changed the value in the object' {
200- { Set-SqlDscStartupParameter - ServiceObject $mockServiceObject - TraceFlag 4199 - WhatIf } | Should -Not - Throw
200+ $null = Set-SqlDscStartupParameter - ServiceObject $mockServiceObject - TraceFlag 4199 - WhatIf
201201
202202 # This is the object created by the mock and modified by the command.
203203 $mockServiceObject.StartupParameters | Should - BeExactly $mockStartupParameters
@@ -208,7 +208,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
208208
209209 Context ' When passing parameter ServerObject over the pipeline' {
210210 It ' Should call the mocked method and have correct value in the object' {
211- { $mockServiceObject | Set-SqlDscStartupParameter - TraceFlag 4199 - Force } | Should -Not - Throw
211+ $null = $mockServiceObject | Set-SqlDscStartupParameter - TraceFlag 4199 - Force
212212
213213 # This is the object created by the mock and modified by the command.
214214 $mockServiceObject.StartupParameters | Should - BeExactly ($mockStartupParameters + ' ;-T4199' )
@@ -243,7 +243,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
243243
244244 Context ' When using parameter Confirm with value $false' {
245245 It ' Should call the mocked method and have correct value in the object' {
246- { Set-SqlDscStartupParameter - TraceFlag 4199 - Confirm:$false } | Should -Not - Throw
246+ $null = Set-SqlDscStartupParameter - TraceFlag 4199 - Confirm:$false
247247
248248 # This is the object created by the mock and modified by the command.
249249 $mockServiceObject.StartupParameters | Should - BeExactly ($mockStartupParameters + ' ;-T4199' )
@@ -254,7 +254,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
254254
255255 Context ' When using parameter Force' {
256256 It ' Should call the mocked method and have correct value in the object' {
257- { Set-SqlDscStartupParameter - TraceFlag 4199 - Force } | Should -Not - Throw
257+ $null = Set-SqlDscStartupParameter - TraceFlag 4199 - Force
258258
259259 # This is the object created by the mock and modified by the command.
260260 $mockServiceObject.StartupParameters | Should - BeExactly ($mockStartupParameters + ' ;-T4199' )
@@ -265,7 +265,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
265265
266266 Context ' When using parameter WhatIf' {
267267 It ' Should not call the mocked method and should not have changed the value in the object' {
268- { Set-SqlDscStartupParameter - TraceFlag 4199 - WhatIf } | Should -Not - Throw
268+ $null = Set-SqlDscStartupParameter - TraceFlag 4199 - WhatIf
269269
270270 # This is the object created by the mock and modified by the command.
271271 $mockServiceObject.StartupParameters | Should - BeExactly $mockStartupParameters
@@ -300,7 +300,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
300300 }
301301
302302 It ' Should call the mocked method and have correct value in the object' {
303- { Set-SqlDscStartupParameter - TraceFlag @ () - Force } | Should -Not - Throw
303+ $null = Set-SqlDscStartupParameter - TraceFlag @ () - Force
304304
305305 # This is the object created by the mock and modified by the command.
306306 $mockServiceObject.StartupParameters | Should - BeExactly $mockExpectedStartupParameters
@@ -333,7 +333,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
333333 }
334334
335335 It ' Should call the mocked method and have correct value in the object' {
336- { Set-SqlDscStartupParameter - InternalTraceFlag 8688 - Confirm:$false } | Should -Not - Throw
336+ $null = Set-SqlDscStartupParameter - InternalTraceFlag 8688 - Confirm:$false
337337
338338 # This is the object created by the mock and modified by the command.
339339 $mockServiceObject.StartupParameters | Should - BeExactly ($mockStartupParameters + ' ;-t8688' )
@@ -367,7 +367,7 @@ Describe 'Set-SqlDscStartupParameter' -Tag 'Public' {
367367 }
368368
369369 It ' Should call the mocked method and have correct value in the object, removed all internal trace flag ang kept normal trace flags' {
370- { Set-SqlDscStartupParameter - InternalTraceFlag @ () - Force } | Should -Not - Throw
370+ $null = Set-SqlDscStartupParameter - InternalTraceFlag @ () - Force
371371
372372 # This is the object created by the mock and modified by the command.
373373 $mockServiceObject.StartupParameters | Should - BeExactly $mockExpectedStartupParameters
0 commit comments