Exemple #1
0
        /// <summary>
        /// Write invalid argument error.
        /// </summary>
        private void WriteInvalidArgumentError(PSRemotingErrorId errorId, string resourceString, object errorArgument)
        {
            String message = GetMessage(resourceString, errorArgument);

            WriteError(new ErrorRecord(new ArgumentException(message), errorId.ToString(),
                ErrorCategory.InvalidArgument, errorArgument));
        }
Exemple #2
0
 internal string GetMessage(PSRemotingErrorId errorId, params object[] args) => args == null?ResourceManagerCache.GetResourceString("RemotingErrorIdStrings", errorId.ToString()) : ResourceManagerCache.FormatResourceString("RemotingErrorIdStrings", errorId.ToString(), args);
        private void WriteInvalidArgumentError(PSRemotingErrorId errorId, string resourceString, object errorArgument)
        {
            string message = base.GetMessage(resourceString, new object[] { errorArgument });

            base.WriteError(new ErrorRecord(new ArgumentException(message), errorId.ToString(), ErrorCategory.InvalidArgument, errorArgument));
        }
 internal static string FormatResourceString(PSRemotingErrorId messageId, params object[] args) => ResourceManagerCache.FormatResourceString("RemotingErrorIdStrings", messageId.ToString(), args);