Rename the CimCmdlet resource file (#12955)

This commit is contained in:
Ilya authored and GitHub committed 2020-06-15 11:00:02 -07:00
1 parent ed4cd20d80
commit 409bd318f1
9 files changed
+31 -31

No files matched your search

@@ -395,7 +395,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
if (nameset.Count == 0)
{
throw new PSArgumentException(Strings.UnableToResolveParameterSetName);
throw new PSArgumentException(CimCmdletStrings.UnableToResolveParameterSetName);
}
else
{
@@ -452,7 +452,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
if (boundParameterSetName != null)
{
throw new PSArgumentException(Strings.UnableToResolveParameterSetName);
throw new PSArgumentException(CimCmdletStrings.UnableToResolveParameterSetName);
}
boundParameterSetName = parameterSetName;
@@ -465,7 +465,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
// throw if there are > 1 parameter set
if (noMandatoryParameterSet.Count > 1)
{
throw new PSArgumentException(Strings.UnableToResolveParameterSetName);
throw new PSArgumentException(CimCmdletStrings.UnableToResolveParameterSetName);
}
else if (noMandatoryParameterSet.Count == 1)
{
@@ -482,7 +482,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
// throw if still can not find the parameter set name
if (boundParameterSetName == null)
{
throw new PSArgumentException(Strings.UnableToResolveParameterSetName);
throw new PSArgumentException(CimCmdletStrings.UnableToResolveParameterSetName);
}
return boundParameterSetName;
@@ -903,7 +903,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
string parameterName,
PasswordAuthenticationMechanism authentication)
{
string message = string.Format(CultureInfo.CurrentUICulture, Strings.InvalidAuthenticationTypeWithNullCredential,
string message = string.Format(CultureInfo.CurrentUICulture, CimCmdletStrings.InvalidAuthenticationTypeWithNullCredential,
authentication,
ImpersonatedAuthenticationMechanism.None,
ImpersonatedAuthenticationMechanism.Negotiate,
@@ -926,7 +926,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
string conflictParameterName)
{
string message = string.Format(CultureInfo.CurrentUICulture,
Strings.ConflictParameterWasSet,
CimCmdletStrings.ConflictParameterWasSet,
parameterName, conflictParameterName);
PSArgumentException exception = new PSArgumentException(message, parameterName);
ThrowTerminatingError(exception, operationName);
@@ -955,7 +955,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
propList.Append(property);
}
string message = string.Format(CultureInfo.CurrentUICulture, Strings.CouldNotFindPropertyFromGivenClass,
string message = string.Format(CultureInfo.CurrentUICulture, CimCmdletStrings.CouldNotFindPropertyFromGivenClass,
className, propList);
PSArgumentOutOfRangeException exception = new PSArgumentOutOfRangeException(
parameterName, actualValue, message);
@@ -392,7 +392,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
if (declaration == null)
{
throw new ArgumentException(string.Format(
CultureInfo.CurrentUICulture, Strings.InvalidMethod, methodName, className));
CultureInfo.CurrentUICulture, CimCmdletStrings.InvalidMethod, methodName, className));
}
}
else if (cimInstance != null)
@@ -407,7 +407,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
if (paramDeclaration == null)
{
throw new ArgumentException(string.Format(
CultureInfo.CurrentUICulture, Strings.InvalidMethodParameter, parameterName, methodName, className));
CultureInfo.CurrentUICulture, CimCmdletStrings.InvalidMethodParameter, parameterName, methodName, className));
}
parameter = CimMethodParameter.Create(
@@ -169,7 +169,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("queryDialect = '{0}'; queryExpression = '{1}'", 0, queryDialect, queryExpression);
if (cimSession == null)
{
throw new ArgumentNullException(string.Format(CultureInfo.CurrentUICulture, Strings.NullArgument, @"cimSession"));
throw new ArgumentNullException(string.Format(CultureInfo.CurrentUICulture, CimCmdletStrings.NullArgument, @"cimSession"));
}
this.TargetComputerName = cimSession.ComputerName;
@@ -553,7 +553,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
errRecords.Add(
new ErrorRecord(
new CimException(string.Format(CultureInfo.CurrentUICulture, Strings.CouldNotFindCimsessionObject, propertyName, propertyValue)),
new CimException(string.Format(CultureInfo.CurrentUICulture, CimCmdletStrings.CouldNotFindCimsessionObject, propertyName, propertyValue)),
string.Empty,
ErrorCategory.ObjectNotFound,
null));
@@ -872,7 +872,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
}
string operationStartMessage = string.Format(CultureInfo.CurrentUICulture,
Strings.CimOperationStart,
CimCmdletStrings.CimOperationStart,
operation,
(parameters.Length == 0) ? "null" : parameters.ToString());
WriteMessage((UInt32)CimWriteMessageChannel.Verbose, operationStartMessage);
@@ -888,7 +888,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
DebugHelper.WriteLogEx();
string operationCompleteMessage = string.Format(CultureInfo.CurrentUICulture,
Strings.CimOperationCompleted,
CimCmdletStrings.CimOperationCompleted,
operation);
WriteMessage((UInt32)CimWriteMessageChannel.Verbose, operationCompleteMessage);
}
@@ -1104,7 +1104,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("EnableMethodResultStreaming = {0}", 0, this.options.EnableMethodResultStreaming);
this.CheckAvailability();
this.targetCimInstance = instance;
this.operationName = Strings.CimOperationNameCreateInstance;
this.operationName = CimCmdletStrings.CimOperationNameCreateInstance;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"instance", instance);
@@ -1124,7 +1124,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("namespace = {0}; classname = {1};", 0, namespaceName, instance.CimSystemProperties.ClassName);
this.CheckAvailability();
this.targetCimInstance = instance;
this.operationName = Strings.CimOperationNameDeleteInstance;
this.operationName = CimCmdletStrings.CimOperationNameDeleteInstance;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"instance", instance);
@@ -1144,7 +1144,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("namespace = {0}; classname = {1}; keyonly = {2}", 0, namespaceName, instance.CimSystemProperties.ClassName, this.options.KeysOnly);
this.CheckAvailability();
this.targetCimInstance = instance;
this.operationName = Strings.CimOperationNameGetInstance;
this.operationName = CimCmdletStrings.CimOperationNameGetInstance;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"instance", instance);
@@ -1164,7 +1164,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("namespace = {0}; classname = {1}", 0, namespaceName, instance.CimSystemProperties.ClassName);
this.CheckAvailability();
this.targetCimInstance = instance;
this.operationName = Strings.CimOperationNameModifyInstance;
this.operationName = CimCmdletStrings.CimOperationNameModifyInstance;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"instance", instance);
@@ -1195,7 +1195,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("Instance class {0}, association class {1}", 0, sourceInstance.CimSystemProperties.ClassName, associationClassName);
this.CheckAvailability();
this.targetCimInstance = sourceInstance;
this.operationName = Strings.CimOperationNameEnumerateAssociatedInstances;
this.operationName = CimCmdletStrings.CimOperationNameEnumerateAssociatedInstances;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"sourceInstance", sourceInstance);
@@ -1218,7 +1218,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("KeyOnly {0}", 0, this.options.KeysOnly);
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameEnumerateInstances;
this.operationName = CimCmdletStrings.CimOperationNameEnumerateInstances;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"className", className);
@@ -1263,7 +1263,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("KeyOnly = {0}", 0, this.options.KeysOnly);
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameQueryInstances;
this.operationName = CimCmdletStrings.CimOperationNameQueryInstances;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"queryDialect", queryDialect);
@@ -1283,7 +1283,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("namespace {0}", 0, namespaceName);
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameEnumerateClasses;
this.operationName = CimCmdletStrings.CimOperationNameEnumerateClasses;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.WriteOperationStartMessage(this.operationName, this.operationParameters);
@@ -1300,7 +1300,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameEnumerateClasses;
this.operationName = CimCmdletStrings.CimOperationNameEnumerateClasses;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"className", className);
@@ -1320,7 +1320,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("namespace = {0}, className = {1}", 0, namespaceName, className);
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameGetClass;
this.operationName = CimCmdletStrings.CimOperationNameGetClass;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"className", className);
@@ -1347,7 +1347,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("EnableMethodResultStreaming = {0}", 0, this.options.EnableMethodResultStreaming);
this.CheckAvailability();
this.targetCimInstance = instance;
this.operationName = Strings.CimOperationNameInvokeMethod;
this.operationName = CimCmdletStrings.CimOperationNameInvokeMethod;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"instance", instance);
@@ -1373,7 +1373,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("EnableMethodResultStreaming = {0}", 0, this.options.EnableMethodResultStreaming);
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameInvokeMethod;
this.operationName = CimCmdletStrings.CimOperationNameInvokeMethod;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"className", className);
@@ -1400,7 +1400,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
DebugHelper.WriteLogEx("QueryDialect = '{0}'; queryExpression = '{1}'", 0, queryDialect, queryExpression);
this.CheckAvailability();
this.targetCimInstance = null;
this.operationName = Strings.CimOperationNameSubscribeIndication;
this.operationName = CimCmdletStrings.CimOperationNameSubscribeIndication;
this.operationParameters.Clear();
this.operationParameters.Add(@"namespaceName", namespaceName);
this.operationParameters.Add(@"queryDialect", queryDialect);
@@ -1904,7 +1904,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
if (!this.Completed)
{
throw new InvalidOperationException(Strings.OperationInProgress);
throw new InvalidOperationException(CimCmdletStrings.OperationInProgress);
}
}
@@ -232,7 +232,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
// can not modify ReadOnly property
exception = new CimException(string.Format(CultureInfo.CurrentUICulture,
Strings.CouldNotModifyReadonlyProperty, key, cimInstance));
CimCmdletStrings.CouldNotModifyReadonlyProperty, key, cimInstance));
return false;
}
// allow modify the key property value as long as it is not readonly,
@@ -281,7 +281,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
if (e.NativeErrorCode == NativeErrorCode.Failed)
{
string errorMessage = string.Format(CultureInfo.CurrentUICulture,
Strings.UnableToAddPropertyToInstance,
CimCmdletStrings.UnableToAddPropertyToInstance,
newProperty.Name,
cimInstance);
exception = new CimException(errorMessage, e);
@@ -48,7 +48,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
this.currentOperation = theCurrentOperation;
if (string.IsNullOrEmpty(theStatusDescription))
{
this.statusDescription = Strings.DefaultStatusDescription;
this.statusDescription = CimCmdletStrings.DefaultStatusDescription;
}
else
{
@@ -434,7 +434,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
}
DebugHelper.WriteLogEx("An invalid name: {0}={1}", 0, parameterName, value);
throw new ArgumentException(string.Format(CultureInfo.CurrentUICulture, Strings.InvalidParameterValue, value, parameterName));
throw new ArgumentException(string.Format(CultureInfo.CurrentUICulture, CimCmdletStrings.InvalidParameterValue, value, parameterName));
}
/// <summary>