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 } }