@@ -292,11 +292,11 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
292
292
# not a .Net type so can't use BeOfType
293
293
$newItem.PSObject.TypeNames [0 ] | Should Be " Microsoft.WSMan.Management.WSManConfigContainerElement#ComputerLevel"
294
294
$newItem.Name | Should Be $expected
295
- Remove-Item WSMan:\$name
295
+ Remove-Item WSMan:\$name - Recurse - Force
296
296
" WSMan:\$name " | Should Not Exist
297
297
}
298
298
finally {
299
- Remove-Item WSMan:\$name - Force - ErrorAction SilentlyContinue
299
+ Remove-Item WSMan:\$name - Recurse - Force - ErrorAction SilentlyContinue
300
300
}
301
301
}
302
302
@@ -314,11 +314,11 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
314
314
$property.Value | Should Be $listenerXml.Listener .$ ($property.Name )
315
315
}
316
316
}
317
- Remove-Item - Path " WSMan:\localhost\Listener\$listenerName " - Force
317
+ Remove-Item - Path " WSMan:\localhost\Listener\$listenerName " - Recurse - Force
318
318
$newListener.PSPath | Should Not Exist
319
319
}
320
320
finally {
321
- Remove-Item - Path " WSMan:\localhost\Listener\$listenerName " - Force - ErrorAction SilentlyContinue
321
+ Remove-Item - Path " WSMan:\localhost\Listener\$listenerName " - Recurse - Force - ErrorAction SilentlyContinue
322
322
}
323
323
}
324
324
@@ -332,11 +332,11 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
332
332
- RunAsCredential $creds
333
333
$expectedMissingProperties = @ (" InitializationParameters" )
334
334
Test-Plugin - Plugin $plugin - expectedMissingProperties $expectedMissingProperties
335
- Remove-Item WSMan:\localhost\Plugin\TestPlugin2\
335
+ Remove-Item WSMan:\localhost\Plugin\TestPlugin2\ - Recurse - Force
336
336
" WSMan:\localhost\Plugin\TestPlugin2" | Should Not Exist
337
337
}
338
338
finally {
339
- Remove-Item WSMan:\localhost\Plugin\TestPlugin2\ - Force - ErrorAction SilentlyContinue
339
+ Remove-Item WSMan:\localhost\Plugin\TestPlugin2\ - Recurse - Force - ErrorAction SilentlyContinue
340
340
}
341
341
}
342
342
@@ -363,11 +363,11 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
363
363
try {
364
364
$plugin = New-Item - Path WSMan:\localhost\Plugin - File $testdrive \plugin.xml - Name TestPlugin2
365
365
Test-Plugin - Plugin $plugin
366
- Remove-Item WSMan:\localhost\Plugin\TestPlugin2\
366
+ Remove-Item WSMan:\localhost\Plugin\TestPlugin2\ - Recurse - Force
367
367
" WSMan:\localhost\Plugin\TestPlugin2\" | Should Not Exist
368
368
}
369
369
finally {
370
- Remove-Item " WSMan:\localhost\Plugin\TestPlugin2\" - Force - ErrorAction SilentlyContinue
370
+ Remove-Item " WSMan:\localhost\Plugin\TestPlugin2\" - Recurse - Force - ErrorAction SilentlyContinue
371
371
}
372
372
}
373
373
@@ -379,11 +379,11 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
379
379
$properties = Get-ChildItem $resource.PSPath
380
380
($properties | Where-Object { $_.Name -eq " ResourceUri" }).Value | Should Be " http://foo/"
381
381
($properties | Where-Object { $_.Name -eq " Capability" })[0 ].Value | Should Be " shell"
382
- Remove-Item $resource.PSPath
382
+ Remove-Item $resource.PSPath - Recurse - Force
383
383
$resource.PSPath | Should Not Exist
384
384
}
385
385
finally {
386
- Remove-Item $resource.PSPath - Force - ErrorAction SilentlyContinue
386
+ Remove-Item $resource.PSPath - Recurse - Force - ErrorAction SilentlyContinue
387
387
}
388
388
}
389
389
@@ -394,7 +394,7 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
394
394
$parameterObj = Get-Item $parameter.PSPath
395
395
$parameterObj.Name | Should Be " foo"
396
396
$parameterObj.Value | Should Be " bar"
397
- Remove-Item $parameter.PSPath
397
+ Remove-Item $parameter.PSPath - Force
398
398
$parameter.PSPath | Should Not Exist
399
399
}
400
400
finally {
@@ -407,16 +407,16 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
407
407
$sddl = " O:NSG:BAD:P(A;;GA;;;BA)"
408
408
$resource = Get-ChildItem - Path WSMan:\localhost\Plugin\TestPlugin\Resources\ | Select-Object - First 1
409
409
# remove existing security resource since the folder name is just a hash of the resource uri
410
- Get-ChildItem " $ ( $resource.PSPath ) \Security" | Remove-Item
410
+ Get-ChildItem " $ ( $resource.PSPath ) \Security" | Remove-Item - Recurse - Force
411
411
$security = New-Item " $ ( $resource.PSPath ) \Security" - SDDL $sddl - Force
412
412
$security.PSPath | Should Exist
413
413
$securityObj = Get-Item $security.PSPath
414
414
(Get-ChildItem $securityObj.PSPath | Where-Object { $_.Name -eq ' sddl' }).Value | Should Be $sddl
415
- Remove-Item $security.PSPath
415
+ Remove-Item $security.PSPath - Recurse - Force
416
416
$security.PSPath | Should Not Exist
417
417
}
418
418
finally {
419
- Remove-Item $security.PSPath - Force - ErrorAction SilentlyContinue
419
+ Remove-Item $security.PSPath - Recurse - Force - ErrorAction SilentlyContinue
420
420
}
421
421
}
422
422
}
0 commit comments