Fix Get-Service non-terminating error message to include category (#20276) (#20529)

This commit is contained in:
Aditya Patwardhan
2023-10-19 14:35:09 -07:00
committed by GitHub
parent 62699bd4c5
commit b49de754e3
@@ -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;