From e08e56c2b72e550f5e0774311d268721fc1cdbfd Mon Sep 17 00:00:00 2001 From: Dan Travison Date: Fri, 12 Jan 2018 16:01:12 -0800 Subject: [PATCH] Fix escape string translation. --- .../resources/EventResource.resx | 490 ++++++++++++++---- tools/ResxGen/ResxGen.psm1 | 16 +- 2 files changed, 395 insertions(+), 111 deletions(-) diff --git a/src/System.Management.Automation/resources/EventResource.resx b/src/System.Management.Automation/resources/EventResource.resx index 5099674c6eb..5e15cdbf4c6 100644 --- a/src/System.Management.Automation/resources/EventResource.resx +++ b/src/System.Management.Automation/resources/EventResource.resx @@ -1,8 +1,8 @@ @@ -64,190 +64,309 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - A message was not found for event id PowerShell-Core-Instrumentation.man. + A message was not found for event id PowerShell.Core.Instrumentation.man. - Scheduled Job {0} started at {1} %n + Scheduled Job {0} started at {1} + - Scheduled Job {0} completed at {1} with state {2} %n + Scheduled Job {0} completed at {1} with state {2} + - Scheduled Job Exception {0}: %n Message: {1} %n StackTrace: {2} %n InnerException: {3} %n + Scheduled Job Exception {0}: + Message: {1} + StackTrace: {2} + InnerException: {3} + - Workflow plugin loaded. %n %t EndpointName: {0} %n %t User: {1} %n %t HostingMode: {2} %n %t Protocol: {3} %n %t Configuration: %n {4} + Workflow plugin loaded. + EndpointName: {0} + User: {1} + HostingMode: {2} + Protocol: {3} + Configuration: + {4} - Workflow execution started. %n %t WorkflowId: {0} %n %t ManagedNodes: {1} + Workflow execution started. + WorkflowId: {0} + ManagedNodes: {1} - Workflow state changed. %n %t WorkflowId: {0} %n %t NewState: {1} %n %t OldState: {2} + Workflow state changed. + WorkflowId: {0} + NewState: {1} + OldState: {2} - Workflow plugin has been requested for a shutdown. %n %t EndpointName: {0} + Workflow plugin has been requested for a shutdown. + EndpointName: {0} - Workflow plugin restarted. %n %t EndpointName: {0} + Workflow plugin restarted. + EndpointName: {0} - Workflow is resuming. %n %t WorkflowId: {0} + Workflow is resuming. + WorkflowId: {0} - A quota limit that was set for the endpoint was exceeded. %n %t EndpointName: {0} %n %t ConfigName: {1} %n %t AllowedValue: {2} %n %t ValueInQuestion: {3} + A quota limit that was set for the endpoint was exceeded. + EndpointName: {0} + ConfigName: {1} + AllowedValue: {2} + ValueInQuestion: {3} - Workflow has resumed. %n %t WorkflowId: {0} + Workflow has resumed. + WorkflowId: {0} - Workflow runspace pool was created. %n %t WorkflowId: {0} %n %t ManagedNode: {1} + Workflow runspace pool was created. + WorkflowId: {0} + ManagedNode: {1} - Activity was queued for execution. %n %t WorkflowId: {0} %n %t ActivityName: {1} + Activity was queued for execution. + WorkflowId: {0} + ActivityName: {1} - Activity execution started. %n %t ActivityName: {0} %n %t ActivityTypeName: {1} + Activity execution started. + ActivityName: {0} + ActivityTypeName: {1} - Workflow is being imported from a XAML file. %n %t WorkflowId: {0} %n %t XamlFile: {1} + Workflow is being imported from a XAML file. + WorkflowId: {0} + XamlFile: {1} - Workflow has been imported from a XAML file. %n %t WorkflowId: {0} %n %t XamlFile: {1} + Workflow has been imported from a XAML file. + WorkflowId: {0} + XamlFile: {1} - Workflow could not be imported from a XAML file because of an error. %n %t WorkflowId: {0} %n %t ErrorDescription: {1} + Workflow could not be imported from a XAML file because of an error. + WorkflowId: {0} + ErrorDescription: {1} - Workflow validation started. %n %t WorkflowId: {0} + Workflow validation started. + WorkflowId: {0} - Workflow validation succeeded. %n %t WorkflowId: {0} + Workflow validation succeeded. + WorkflowId: {0} - Workflow validation failed with error. %n %t WorkflowId: {0} + Workflow validation failed with error. + WorkflowId: {0} - Workflow activity validated. %n %t WorkflowId: {0} %n %t ActivityDisplayName: {1} %n %t ActivityTypeName: {2} + Workflow activity validated. + WorkflowId: {0} + ActivityDisplayName: {1} + ActivityTypeName: {2} - Workflow activity could not be validated. %n %t WorkflowId: {0} %n %t ActivityDisplayName: {1} %n %t ActivityTypeName: {2} + Workflow activity could not be validated. + WorkflowId: {0} + ActivityDisplayName: {1} + ActivityTypeName: {2} - Activity execution failed. %n %t WorkflowId: {0} %n %t ActivityName: {1} %n %t FailureDescription: {2} + Activity execution failed. + WorkflowId: {0} + ActivityName: {1} + FailureDescription: {2} - Runspace availability changed. %n %t RunspaceId: {0} %n %t Availability: {1} + Runspace availability changed. + RunspaceId: {0} + Availability: {1} - Runspace state changed. %n %t RunspaceId: {0} %n %t NewState: {1} %n %t OldState: {2} + Runspace state changed. + RunspaceId: {0} + NewState: {1} + OldState: {2} - Workflow loaded for execution. %n %t WorkflowId: {0} + Workflow loaded for execution. + WorkflowId: {0} - Workflow unloaded. %n %t WorkflowId: {0} + Workflow unloaded. + WorkflowId: {0} - Workflow execution cancelled. %n %t WorkflowId: {0} + Workflow execution cancelled. + WorkflowId: {0} - Workflow execution aborted. %n %t WorkflowId: {0} + Workflow execution aborted. + WorkflowId: {0} - Workflow cleanup operation executed. %n %t WorkflowId: {0} + Workflow cleanup operation executed. + WorkflowId: {0} - Persisted workflow loaded from disk. %n %t WorkflowId: {0} %n %t Path: {1} + Persisted workflow loaded from disk. + WorkflowId: {0} + Path: {1} - Workflow data was deleted from disk. %n %t WorkflowId: {0} %n %t Path: {1} + Workflow data was deleted from disk. + WorkflowId: {0} + Path: {1} - Starting remove job. %n %t JobId: {0} + Starting remove job. + JobId: {0} - Job state changed. %n %t JobId: {0} %n %t WorkflowId: {1} %n %t NewState: {2} %n %t OldState: {3} + Job state changed. + JobId: {0} + WorkflowId: {1} + NewState: {2} + OldState: {3} - Job error. %n %t JobId: {0} %n %t WorkflowId: {1} %n %t ErrorDescription: {2} + Job error. + JobId: {0} + WorkflowId: {1} + ErrorDescription: {2} - Job created for workflow (child job). %n %t ParentJobId: {0} %n %t ChildJobId: {1} %n %t ChildWorkflowId: {2} + Job created for workflow (child job). + ParentJobId: {0} + ChildJobId: {1} + ChildWorkflowId: {2} - Parent job created for workflow. %n %t JobId: {0} + Parent job created for workflow. + JobId: {0} - All required jobs were created for workflow execution. %n %t JobId: {0} %n %t WorkflowId: {1} + All required jobs were created for workflow execution. + JobId: {0} + WorkflowId: {1} - Child job removed for workflow. %n %t ParentJobId: {0} %n %t ChildJobId: {1} %n %t WorkflowId: {2} + Child job removed for workflow. + ParentJobId: {0} + ChildJobId: {1} + WorkflowId: {2} - An error occurred while removing job. %n %t ParentJobId: {0} %n %t ChildJobId: {1} %n %t WorkflowId: {2} %n %t Error: {3} + An error occurred while removing job. + ParentJobId: {0} + ChildJobId: {1} + WorkflowId: {2} + Error: {3} - Loading workflow for execution. %n %t WorkflowId: {0} + Loading workflow for execution. + WorkflowId: {0} - Workflow execution finished. %n %t WorkflowId: {0} + Workflow execution finished. + WorkflowId: {0} - Cancelling workflow execution. %n %t WorkflowId: {0} + Cancelling workflow execution. + WorkflowId: {0} - Aborting workflow execution. %n %t WorkflowId: {0} %n %t Reason: {1} + Aborting workflow execution. + WorkflowId: {0} + Reason: {1} - Unloading workflow. %n %t WorkflowId: {0} + Unloading workflow. + WorkflowId: {0} - Forced workflow shutdown started. %n %t WorkflowId: {0} + Forced workflow shutdown started. + WorkflowId: {0} - Forced workflow shutdown finished. %n %t WorkflowId: {0} + Forced workflow shutdown finished. + WorkflowId: {0} - An error occurred while forcefully shutting down a workflow. %n %t WorkflowId: {0} %n %t ErrorDescription: {1} + An error occurred while forcefully shutting down a workflow. + WorkflowId: {0} + ErrorDescription: {1} - Persisting workflow to disk. %n %t WorkflowId: {0} %n %t PersistPath: {1} + Persisting workflow to disk. + WorkflowId: {0} + PersistPath: {1} - Workflow persisted to disk. %n %t WorkflowId: {0} + Workflow persisted to disk. + WorkflowId: {0} - Activity execution finished. %n %t ActivityName: {0} + Activity execution finished. + ActivityName: {0} - Workflow execution error. %n %t WorkflowId: {0} %n %t ErrorDescription: {1} + Workflow execution error. + WorkflowId: {0} + ErrorDescription: {1} - A new PowerShell endpoint was registered. %n %t EndpointName: {0} %n %t EndpointType: {1} %n %t RegisteredBy: {2} + A new PowerShell endpoint was registered. + EndpointName: {0} + EndpointType: {1} + RegisteredBy: {2} - Endpoint configuration modified. %n %t EndpointName: {0} %n %t ModifiedBy: {1} + Endpoint configuration modified. + EndpointName: {0} + ModifiedBy: {1} - Endpoint configuration unregistered. %n %t EndpointName: {0} %n %t UnregisteredBy: {1} + Endpoint configuration unregistered. + EndpointName: {0} + UnregisteredBy: {1} - Endpoint configuration disabled. %n %t EndpointName: {0} %n %t DisabledBy: {1} + Endpoint configuration disabled. + EndpointName: {0} + DisabledBy: {1} - Endpoint configuration enabled. %n %t EndpointName: {0} %n %t EnabledBy: {1} + Endpoint configuration enabled. + EndpointName: {0} + EnabledBy: {1} - Out of process runspace started. %n %t Command: {0} + Out of process runspace started. + Command: {0} - Parameter splatting was performed during workflow execution. %n %t Parameters: {0} %n %t Computers: {1} + Parameter splatting was performed during workflow execution. + Parameters: {0} + Computers: {1} - Workflow engine started. %n %t EndpointName: {0} + Workflow engine started. + EndpointName: {0} - Workflow manager instantiated with %n %t CheckpointPath: {0} %n %t ConfigProviderId: {1} %n %t UserName: {2} %n %t Path: {3} + Workflow manager instantiated with + CheckpointPath: {0} + ConfigProviderId: {1} + UserName: {2} + Path: {3} Computer Name $null or . resolve to LocalHost @@ -259,49 +378,124 @@ Remote shell name resolved to default PowerShellCore - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - Creating Scriptblock text ({0} of {1}):%n{2}%n%nScriptBlock ID: {3}%nPath: {4} + Creating Scriptblock text ({0} of {1}): +{2} + +ScriptBlock ID: {3} +Path: {4} - Started invocation of ScriptBlock ID: {0}%nRunspace ID: {1} + Started invocation of ScriptBlock ID: {0} +Runspace ID: {1} - Completed invocation of ScriptBlock ID: {0}%nRunspace ID: {1} + Completed invocation of ScriptBlock ID: {0} +Runspace ID: {1} - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - {2}%n%nContext:%n{0}%n%nUser Data:%n{1}%n + {2} + +Context: +{0} + +User Data: +{1} + - Correlating activity id's. %n %t CurrentActivityId: {0} %n %t ParentActivityId: {1} + Correlating activity id's. + CurrentActivityId: {0} + ParentActivityId: {1} - Class Name = {0}%nMethod Name = {1}%nWorkflow GUID = {2}%nMessage = {3}%n{4}%nActivity Name = {5}%nActivity GUID = {6}%nParameters = {7} + Class Name = {0} +Method Name = {1} +Workflow GUID = {2} +Message = {3} +{4} +Activity Name = {5} +Activity GUID = {6} +Parameters = {7} - Creating Runspace object %n %t Instance Id: {0} + Creating Runspace object + Instance Id: {0} - Creating RunspacePool object %n %t InstanceId {0} %n %t MinRunspaces {1} %n %t MaxRunspaces {2} + Creating RunspacePool object + InstanceId {0} + MinRunspaces {1} + MaxRunspaces {2} Opening RunspacePool @@ -346,7 +540,18 @@ Test analytic message - Connection Paramters are %n Connection URI: {0} %n Resource URI: {1} %n User: {2} %n OpenTimeout: {3} %n IdleTimeout: {4} %n CancelTimeout: {5} %n AuthenticationMechanism: {6} %n Thumb Print: {7} %n MaxUriRedirectionCount: {8} %n MaxReceivedDataSizePerCommand: {0}0 %n MaxReceivedObjectSize: {0}1 + Connection Paramters are + Connection URI: {0} + Resource URI: {1} + User: {2} + OpenTimeout: {3} + IdleTimeout: {4} + CancelTimeout: {5} + AuthenticationMechanism: {6} + Thumb Print: {7} + MaxUriRedirectionCount: {8} + MaxReceivedDataSizePerCommand: {0}0 + MaxReceivedObjectSize: {0}1 Modifying activity Id and correlating @@ -355,16 +560,26 @@ Received object with Runspace Id: {0} Command Id: {1} Destination: {2} DataType: {3} TargetInterface: {4} - An unhandled exception occurred in the appdomain. %nException Type: {0} %nException Message: {1} %nException StackTrace: {2} + An unhandled exception occurred in the appdomain. +Exception Type: {0} +Exception Message: {1} +Exception StackTrace: {2} - Runspace Id: {0} Pipeline Id: {1}. WSMan reported an error with error code: {2}. %n Error message: {3} %n StackTrace: {4} + Runspace Id: {0} Pipeline Id: {1}. WSMan reported an error with error code: {2}. + Error message: {3} + StackTrace: {4} - An unhandled exception occurred in the appdomain. %nException Type: {0} %nException Message: {1} %nException StackTrace: {2} + An unhandled exception occurred in the appdomain. +Exception Type: {0} +Exception Message: {1} +Exception StackTrace: {2} - Runspace Id: {0} Pipeline Id: {1}. WSMan reported an error with error code: {2}. %n Error message: {3} %n StackTrace: {4} + Runspace Id: {0} Pipeline Id: {1}. WSMan reported an error with error code: {2}. + Error message: {3} + StackTrace: {4} Runspace Id {0}. Establishing a connection using WSMan Create Shell @@ -421,7 +636,10 @@ Reporting context for request: {0} Context Reported: {0} - Reporting operation complete for request: {0} %n Error Code: {1} %n Error Message: {2} %n StackTrace: {3} + Reporting operation complete for request: {0} + Error Code: {1} + Error Message: {2} + StackTrace: {3} Shell Context {0}. Request Id {1}. Creating a commonad session for running a command. @@ -445,46 +663,89 @@ Loading type {0} for custom shell with shell Id {1} - Received remoting fragment. %n %t Object Id: {0} %n %t Fragment Id: {1} %n %t Start Flag: {2} %n %t End Flag: {3} %n %t Payload Length: {4} %n %t Payload Data: {5} + Received remoting fragment. + Object Id: {0} + Fragment Id: {1} + Start Flag: {2} + End Flag: {3} + Payload Length: {4} + Payload Data: {5} - Sent remoting fragment. %n %t Object Id: {0} %n %t Fragment Id: {1} %n %t Start Flag: {2} %n %t End Flag: {3} %n %t Payload Length: {4} %n %t Payload Data: {5} + Sent remoting fragment. + Object Id: {0} + Fragment Id: {1} + Start Flag: {2} + End Flag: {3} + Payload Length: {4} + Payload Data: {5} Shutting down winrm service. - Successfully rehydrated an object. %n %t Deserialized type name: {0} %n %t Rehydrated by casting to type: {1} %n %t Rehydrated object is of type: {2} + Successfully rehydrated an object. + Deserialized type name: {0} + Rehydrated by casting to type: {1} + Rehydrated object is of type: {2} - Failed to rehydrated an object. %n %t Deserialized type name: {0} %n %t Rehydrated by casting to type: {1} %n %t Type cast exception: {2} %n %t Type cast inner exception: {3} + Failed to rehydrated an object. + Deserialized type name: {0} + Rehydrated by casting to type: {1} + Type cast exception: {2} + Type cast inner exception: {3} - Serialization depth has been overriden. %n %t Serialized type name: {0} %n %t Original depth: {1} %n %t Overriden depth: {2} %n %t Current depth below top level: {3} + Serialization depth has been overriden. + Serialized type name: {0} + Original depth: {1} + Overriden depth: {2} + Current depth below top level: {3} - Serialization mode has been overriden. %n %t Serialized type name: {0} %n %t Overriden mode: {1} + Serialization mode has been overriden. + Serialized type name: {0} + Overriden mode: {1} - Serialization of a script property has been skipped, because there is no runspace to use for evaluation of the property. %n %t Property name: {0} %n %t Property owner's type name: {1} %n %t Getter script: {2} + Serialization of a script property has been skipped, because there is no runspace to use for evaluation of the property. + Property name: {0} + Property owner's type name: {1} + Getter script: {2} - Serialization of a property has been skipped, because property getter failed. %n %t Property name: {0} %n %t Property owner's type name: {1} %n %t Exception from property getter: {2} %n %t Inner exception from property getter: {3} + Serialization of a property has been skipped, because property getter failed. + Property name: {0} + Property owner's type name: {1} + Exception from property getter: {2} + Inner exception from property getter: {3} - Serialization of an enumerable object might not be complete, because object being enumerated threw an exception. %n %t Type of object being enumerated: {0} %n %t Exception: {1} + Serialization of an enumerable object might not be complete, because object being enumerated threw an exception. + Type of object being enumerated: {0} + Exception: {1} - Serialization called object's ToString method which failed. %n %t Type of object: {0} %n %t Exception: {1} + Serialization called object's ToString method which failed. + Type of object: {0} + Exception: {1} - Maximum depth below top level has been reached, forcing object to be serialized as strings. %n %t Object type at max depth: {0} %n %t Property name at max depth: {1} %n %t Depth: {2} + Maximum depth below top level has been reached, forcing object to be serialized as strings. + Object type at max depth: {0} + Property name at max depth: {1} + Depth: {2} - XmlException has been thrown by the deserializer (most likely indicating incorrect clixml format). %n %t Line number: {0} Line position: {1} %n %t Exception: {2} + XmlException has been thrown by the deserializer (most likely indicating incorrect clixml format). + Line number: {0} Line position: {1} + Exception: {2} - Serialization of specified properties failed, because one of the specified properties was missing. %n %t Type of object: {0} %n %t Property name: {1} + Serialization of specified properties failed, because one of the specified properties was missing. + Type of object: {0} + Property name: {1} PowerShell console is starting up @@ -496,22 +757,45 @@ {0} - Tracing ErrorRecord: %n Message: {0} %n CategoryInfo.Category: {1} %n CategoryInfo.Reason : {2} %n CategoryInfo.TargetName : {3} %n FullyQualifiedErrorId: {4} %n Exception Details: %n Message : {5} %n Stack Trace: {6} %n InnerException {7} %n + Tracing ErrorRecord: + Message: {0} + CategoryInfo.Category: {1} + CategoryInfo.Reason : {2} + CategoryInfo.TargetName : {3} + FullyQualifiedErrorId: {4} + Exception Details: + Message : {5} + Stack Trace: {6} + InnerException {7} + - Exception: %n Message: {0} %n StackTrace: {1} %n InnerException : {2} %n + Exception: + Message: {0} + StackTrace: {1} + InnerException : {2} + Tracing PSObject - Tracing Job: %n Id: {0} %n InstanceId: {1} %n Name: {2} %n Location: {3} %n State: {4} %n Command: {5} %n + Tracing Job: + Id: {0} + InstanceId: {1} + Name: {2} + Location: {3} + State: {4} + Command: {5} + - Trace Information: %n {0} + Trace Information: + {0} - Trace Information: %n {0} {1} + Trace Information: + {0} {1} BEGIN ImportWorkflowCommand::StartWorkflowApplication. Starting invocation of workflow function. Tracking Guid {0} diff --git a/tools/ResxGen/ResxGen.psm1 b/tools/ResxGen/ResxGen.psm1 index 3f26bf59a61..12f6188e9aa 100644 --- a/tools/ResxGen/ResxGen.psm1 +++ b/tools/ResxGen/ResxGen.psm1 @@ -288,14 +288,14 @@ class EventMessage } static hidden $escapeStrings = - @( - {Source = '%t'; Dest = '`t'}, - {Source = '%n'; Dest = '`n'}, - {Source = '%r'; Dest = '`r'}, - {Source = '%%'; Dest = '`%'}, - {Source = '%space'; Dest = ' '}, - {Source = '%.'; Dest = '.'} - ) + @{ + '%t' = "`t"; + '%n'="`n"; + '%r'="`r"; + '%%'='%'; + '%space'=' '; + '%.'='.' + } }