From 68c15dd4e4eb280dbdd517777b0631fcce24fd85 Mon Sep 17 00:00:00 2001 From: sethvs Date: Thu, 5 Apr 2018 18:22:58 +0300 Subject: [PATCH 1/2] Use -Throw and -ErrorId native Pester parameters. --- .../Microsoft.PowerShell.Management/ControlService.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 index 48864dfec82..8bbe60a6474 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 @@ -91,7 +91,7 @@ Describe "Control Service cmdlet tests" -Tags "Feature","RequireAdminOnWindows" @{script={Restart-Service $(new-guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.RestartServiceCommand"} ) { param($script,$errorid) - { & $script } | ShouldBeErrorId $errorid + { & $script } | Should -Throw -ErrorId $errorid } } From be954a33778c5c9be3c93a93189dd17eb5058bc4 Mon Sep 17 00:00:00 2001 From: sethvs Date: Fri, 6 Apr 2018 12:18:24 +0300 Subject: [PATCH 2/2] [Feature] Use -Throw and -ErrorId native Pester parameters.