From b49de754e37a7fffa6c6ea6ff1164786dd2bd05c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:35:09 -0700 Subject: [PATCH] Fix `Get-Service` non-terminating error message to include category (#20276) (#20529) --- .../commands/management/Service.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 1d007e6dac..7f35e88a85 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -103,7 +103,7 @@ namespace Microsoft.PowerShell.Commands string message = StringUtil.Format(errorMessage, serviceName, displayName, - (innerException == null) ? string.Empty : innerException.Message); + (innerException == null) ? category.ToString() : innerException.Message); var exception = new ServiceCommandException(message, innerException); exception.ServiceName = serviceName;