Skip to content

Resxgen.psm1 is not translating manifest escape characters. #5890

Closed

Description

Steps to reproduce

Run resxgen.ps1 from tools\resxgen.

.\ResxGen.ps1 -Manifest ..\..\src\PowerShell.Core.Instrumentation\PowerShell.Core.Instrumentation.man -ResxPath ..\..\src\System.Management.Automation\resources -CodePath ..\..\src\System.Management.Automation\gen

Expected behavior

escape characters such as %t and %n in manifest messages are translated the tab and newline characters.

Actual behavior

The escape characters are passed through without change.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0
PSEdition                      Core
GitCommitId                    v6.0.0
OS                             Microsoft Windows 10.0.17076
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. daxian-dbw commented on Jan 12, 2018

    @daxian-dbw
    Member

    Example log entry is pasted below, see the character %n in it.

    Jan 12 15:24:16 dongbo-ub powershell[8244]: (v6.0.0:E:11) [Command_Lifecycle:CommandStart.Method.Informational] Command TabExpansion2 is Started.
    %n%nContext:%n        Severity = Informational
            Host Name = ConsoleHost
            Host Version = 6.0.0
            Host ID = 05532e92-2b6c-4fcb-8feb-958b3109b433
            Host Application = /opt/microsoft/powershell/6.0.0/pwsh.dll
            Engine Version = 6.0.0
            Runspace ID = d2acbe66-7422-471f-95dd-f411957a965b
            Pipeline ID = 56
            Command Name = TabExpansion2
            Command Type = Function
            Script Name = 
            Command Path = 
            Sequence Number = 458
            User = dongbo-ub\dongbo
            Connected User = 
            Shell ID = Microsoft.PowerShell
    %n%nUser Data:%n%n
    

    Note that by default the rsyslog will escape control characeters from the log message, and newline character is one of them. So by default you will see all log text appear in one line in syslog and newline character will be replaced to be #012. The example above is what shows up after setting $EscapeControlCharactersOnReceive off in /etc/rsyslog.conf

  2. added
    WG-Maintainers-Build
    on Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Resolution-FixedWG-Maintainers-Build

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions