Repository: PowerShell/PowerShell
File: src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/ContentHelper.Common.cs (C#)

Code before:

using System;
using System.Diagnostics.CodeAnalysis;
using System.Management.Automation;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Humanizer;
using Microsoft.Win32;

namespace Microsoft.PowerShell.Commands
{
    internal static class ContentHelper
    {
        #region Internal Methods

        // ContentType may not exist in response header.  Return null if not.
        internal static string? GetContentType(HttpResponseMessage response) => response.Content.Headers.ContentType?.MediaType;

        internal static string? GetContentType(HttpRequestMessage request) => request.Content?.Headers.ContentType?.MediaType;

        internal static Encoding GetDefaultEncoding() => Encoding.UTF8;

        internal static string GetFriendlyContentLength(long? length) =>
            length.HasValue
            ? $"{length.Value.Bytes().Humanize()} ({length.Value.ToString("#,0").Replace(",", " ")} bytes)"
            : "unknown size";

        internal static StringBuilder GetRawContentHeader(HttpResponseMessage response)
        {
            StringBuilder raw = new();

            string protocol = WebResponseHelper.GetProtocol(response);
            if (!string.IsNullOrEmpty(protocol))
            {
                int statusCode = WebResponseHelper.GetStatusCode(response);
                string statusDescription = WebResponseHelper.GetStatusDescription(response);
                raw.AppendLine($"{protocol} {statusCode} {statusDescription}");
            }

            HttpHeaders[] headerCollections =
            {
                response.Headers,
                response.Content.Headers
            };

            foreach (var headerCollection in headerCollections)
            {
                if (headerCollection == null)
                {
                    continue;

Review comment (suggestion):
I guess Humanize uses current culture. So ToString should do the same.
```suggestion
            ? $"{length.Value.Bytes().Humanize()} ({length.Value.ToString("#,0")} bytes)"
```

Code after:

using System;
using System.Diagnostics.CodeAnalysis;
using System.Management.Automation;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Humanizer;
using Microsoft.Win32;

namespace Microsoft.PowerShell.Commands
{
    internal static class ContentHelper
    {
        #region Internal Methods

        // ContentType may not exist in response header.  Return null if not.
        internal static string? GetContentType(HttpResponseMessage response) => response.Content.Headers.ContentType?.MediaType;

        internal static string? GetContentType(HttpRequestMessage request) => request.Content?.Headers.ContentType?.MediaType;

        internal static Encoding GetDefaultEncoding() => Encoding.UTF8;

        internal static string GetFriendlyContentLength(long? length) =>
            length.HasValue
            ? $"{length.Value.Bytes().Humanize()} ({length.Value:#,0} bytes)"
            : "unknown size";

        internal static StringBuilder GetRawContentHeader(HttpResponseMessage response)
        {
            StringBuilder raw = new();

            string protocol = WebResponseHelper.GetProtocol(response);
            if (!string.IsNullOrEmpty(protocol))
            {
                int statusCode = WebResponseHelper.GetStatusCode(response);
                string statusDescription = WebResponseHelper.GetStatusDescription(response);
                raw.AppendLine($"{protocol} {statusCode} {statusDescription}");
            }

            HttpHeaders[] headerCollections =
            {
                response.Headers,
                response.Content.Headers
            };

            foreach (var headerCollection in headerCollections)
            {
                if (headerCollection == null)
                {
                    continue;