Merge pull request #2106 from jsoref/spelling-debug

spelling: debug

- Fix spelling in debug asserts and tracing
- Fix telemetry event name for PackageManagement
This commit is contained in:
Sergei Vorobev authored and GitHub committed 2016-08-30 15:45:46 -07:00
commit f12c936803
41 files changed
+83 -83

No files matched your search

@@ -388,7 +388,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
/// <param name="cimInstance"></param>
public CimSessionProxy(string computerName, CimInstance cimInstance)
{
DebugHelper.WriteLogEx("ComptuerName {0}; cimInstance.CimSessionInstanceID = {1}; cimInstance.CimSessionComputerName = {2}.",
DebugHelper.WriteLogEx("ComputerName {0}; cimInstance.CimSessionInstanceID = {1}; cimInstance.CimSessionComputerName = {2}.",
0,
computerName,
cimInstance.GetCimSessionInstanceId(),
@@ -716,7 +716,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
lock (this.stateLock)
{
Debug.Assert(this.operation == operation, "Caller should verify that the operation to reomove is the operation in progress");
Debug.Assert(this.operation == operation, "Caller should verify that the operation to remove is the operation in progress");
this.DisposeCancelOperation();
@@ -2139,7 +2139,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
if (!match)
{
DebugHelper.WriteLog("Qualifer name does not match: {0}", 1, context.QualifierName);
DebugHelper.WriteLog("Qualifier name does not match: {0}", 1, context.QualifierName);
return match;
}
}
@@ -330,7 +330,7 @@ namespace Microsoft.PackageManagement.Providers.Internal.Bootstrap {
private bool ValidateFileHash(string fileFullPath, Payload payload) {
Debug("BoostrapRequest::ValidateFileHash");
Debug("BootstrapRequest::ValidateFileHash");
/* format:
* <Payload>
* <File name="nuget-anycpu-2.8.5.205.exe" sha512:hash="a314fc2dc663ae7a6b6bc6787594057396e6b3f569cd50fd5ddb4d1bbafd2b6a" />
@@ -189,7 +189,7 @@ namespace Microsoft.PackageManagement.MetaProvider.PowerShell.Internal {
// we're going to throw an error here because this indicates that the currently
// running powershell call is calling back into PM, and it has called back
// into this provider. That's just bad bad bad.
throw new Exception("Re-entrancy Violation in powershell module");
throw new Exception("Reentrancy Violation in powershell module");
}
try {
@@ -209,7 +209,7 @@ namespace Microsoft.PackageManagement.NuGetProvider
throw new ArgumentNullException("request");
}
try {
request.Debug(string.Format(CultureInfo.InvariantCulture, "AddPackageSource - ProvidenName = '{0}', name='{1}', location='{2}', trusted='{3}'", PackageProviderName, name, location, trusted));
request.Debug(string.Format(CultureInfo.InvariantCulture, "AddPackageSource - ProviderName = '{0}', name='{1}', location='{2}', trusted='{3}'", PackageProviderName, name, location, trusted));
// Error out if a user does not provide package source Name
if (string.IsNullOrWhiteSpace(name))
@@ -140,7 +140,7 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
}
else
{
throw new ArgumentException(string.Format("'{0}' is not referencd but not defined in the file '{1}'", dep.Name, package.FilePath));
throw new ArgumentException(string.Format("'{0}' is referenced but not defined in the file '{1}'", dep.Name, package.FilePath));
}
}
@@ -36,7 +36,7 @@ namespace Microsoft.PackageManagement.Internal.Implementation {
}
public override bool YieldPackageSource(string name, string location, bool isTrusted, bool isRegistered, bool isValidated) {
Debug(String.Format(CultureInfo.CurrentCulture, "Yielding packge source for {0} at location {1}", name, location));
Debug(String.Format(CultureInfo.CurrentCulture, "Yielding package source for {0} at location {1}", name, location));
Activity();
CommitPackageSource();
@@ -924,7 +924,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
Dbg.Assert(
(this.JobContext.ShouldProcessOptimization != MshCommandRuntime.ShouldProcessPossibleOptimization.AutoYes_CanSkipShouldProcessCall) ||
(this.JobContext.CmdletInvocationContext.CmdletDefinitionContext.ClientSideShouldProcess),
"MI layer should not call us when AutoYes_CanSkipShouldProcesCall optimization is in effect");
"MI layer should not call us when AutoYes_CanSkipShouldProcessCall optimization is in effect");
Exception exceptionThrownOnCmdletThread;
ShouldProcessReason shouldProcessReason;
bool shouldProcessResponse = this.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason, out exceptionThrownOnCmdletThread);
@@ -1389,9 +1389,9 @@ namespace Microsoft.PowerShell.Commands
Dictionary<string, string> alias2resolvedCommandName,
PSObject remoteCommandInfo)
{
Dbg.Assert(name2commandMetadata != null, "name2commandMetadata paremeter != null");
Dbg.Assert(alias2resolvedCommandName != null, "alias2resolvedCommandName paremeter != null");
Dbg.Assert(remoteCommandInfo != null, "remoteCommandInfo paremeter != null");
Dbg.Assert(name2commandMetadata != null, "name2commandMetadata parameter != null");
Dbg.Assert(alias2resolvedCommandName != null, "alias2resolvedCommandName parameter != null");
Dbg.Assert(remoteCommandInfo != null, "remoteCommandInfo parameter != null");
string resolvedCommandName;
CommandMetadata commandMetadata = RehydrateCommandMetadata(remoteCommandInfo, out resolvedCommandName);
@@ -1455,8 +1455,8 @@ namespace Microsoft.PowerShell.Commands
private void AddRemoteTypeDefinition(IList<ExtendedTypeDefinition> listOfTypeDefinitions, PSObject remoteTypeDefinition)
{
Dbg.Assert(listOfTypeDefinitions != null, "listOfTypeDefinitions paremeter != null");
Dbg.Assert(remoteTypeDefinition != null, "remoteTypeDefinition paremeter != null");
Dbg.Assert(listOfTypeDefinitions != null, "listOfTypeDefinitions parameter != null");
Dbg.Assert(remoteTypeDefinition != null, "remoteTypeDefinition parameter != null");
ExtendedTypeDefinition typeDefinition = ConvertTo<ExtendedTypeDefinition>("Get-FormatData", remoteTypeDefinition);
if (!IsSafeTypeDefinition(typeDefinition))
@@ -371,7 +371,7 @@ namespace Microsoft.PowerShell.Commands
{
CommandInfo commandInfo;
this.GetCommandInfoAndModules(out commandInfo, out _importedModules);
Diagnostics.Assert(commandInfo != null, "GetCommandInfoAndModules would throw a termninating error/exception");
Diagnostics.Assert(commandInfo != null, "GetCommandInfoAndModules would throw a terminating error/exception");
try
{
@@ -376,7 +376,7 @@ namespace Microsoft.PowerShell.Commands
}
else
{
Dbg.Assert(false, "Either RunspaceConfiguration or InitiaSessionState must be non-null for Update-Typedata to work");
Dbg.Assert(false, "Either RunspaceConfiguration or InitialSessionState must be non-null for Update-Typedata to work");
}
}
}
@@ -494,7 +494,7 @@ namespace Microsoft.PowerShell.Commands
}
else
{
Dbg.Assert(false, "Either RunspaceConfiguration or InitiaSessionState must be non-null for Update-Typedata to work");
Dbg.Assert(false, "Either RunspaceConfiguration or InitialSessionState must be non-null for Update-Typedata to work");
}
}
}
@@ -887,7 +887,7 @@ namespace Microsoft.PowerShell.Commands
}
else
{
Dbg.Assert(false, "Either RunspaceConfiguration or InitiaSessionState must be non-null for Update-Typedata to work");
Dbg.Assert(false, "Either RunspaceConfiguration or InitialSessionState must be non-null for Update-Typedata to work");
}
}
@@ -1069,7 +1069,7 @@ namespace Microsoft.PowerShell.Commands
}
else
{
Dbg.Assert(false, "Either RunspaceConfiguration or InitiaSessionState must be non-null for Update-FormatData to work");
Dbg.Assert(false, "Either RunspaceConfiguration or InitialSessionState must be non-null for Update-FormatData to work");
}
}
}
@@ -1289,7 +1289,7 @@ namespace Microsoft.PowerShell.Commands
}
else
{
Dbg.Assert(false, "Either RunspaceConfiguration or InitiaSessionState must be non-null for Remove-Typedata to work");
Dbg.Assert(false, "Either RunspaceConfiguration or InitialSessionState must be non-null for Remove-Typedata to work");
}
}
}
@@ -49,8 +49,8 @@ namespace Microsoft.Management.UI.Internal
/// <returns>the next highlight starting at the <paramref name="caretPosition"/></returns>
internal Run MoveAndHighlightNextNextMatch(bool forward, TextPointer caretPosition)
{
Debug.Assert(caretPosition != null, "a caret position is allways valid");
Debug.Assert(caretPosition.Parent != null && caretPosition.Parent is Run, "a caret PArent is allways a valid Run");
Debug.Assert(caretPosition != null, "a caret position is always valid");
Debug.Assert(caretPosition.Parent != null && caretPosition.Parent is Run, "a caret Parent is always a valid Run");
Run caretRun = (Run)caretPosition.Parent;
Run currentRun;
@@ -203,7 +203,7 @@ namespace Microsoft.Management.UI.Internal
{
Bold parentBold = run.Parent as Bold;
Paragraph parentParagraph = (parentBold != null ? parentBold.Parent : run.Parent) as Paragraph;
Debug.Assert(parentParagraph != null, "the documents we are saerching are built with ParagraphBuilder, which builds the document like this");
Debug.Assert(parentParagraph != null, "the documents we are searching are built with ParagraphBuilder, which builds the document like this");
return parentParagraph;
}
@@ -227,7 +227,7 @@ namespace Microsoft.Management.UI.Internal
/// <returns>the first or last run in the paragraph containing <paramref name="caretRun"/></returns>
private static Run GetFirstOrLastRun(Run caretRun, bool forward)
{
Debug.Assert(caretRun != null, "a caret run is allways valid");
Debug.Assert(caretRun != null, "a caret run is always valid");
Paragraph paragraph = GetParagraph(caretRun);
@@ -130,7 +130,7 @@ namespace Microsoft.Management.UI.Internal
return;
}
Debug.Assert(this.AvailableColumns.Count == 0, "AvailabeColumns should be empty at this point");
Debug.Assert(this.AvailableColumns.Count == 0, "AvailableColumns should be empty at this point");
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(first);
foreach (PropertyDescriptor property in properties)
@@ -442,7 +442,7 @@ namespace Microsoft.PowerShell.Management.Activities
return;
}
_structuredTracer.DebugMessage("Executing activity '" + this.DisplayName + "', local machine (" + Environment.MachineName + ") is self-restaring");
_structuredTracer.DebugMessage("Executing activity '" + this.DisplayName + "', local machine (" + Environment.MachineName + ") is self-restarting");
base.Execute(context);
}
}
@@ -443,7 +443,7 @@ namespace Microsoft.PowerShell.Internal
{
int err = Marshal.GetLastWin32Error();
Win32Exception innerException = new Win32Exception(err);
throw new Exception("Failed to retreive the input console handle.", innerException);
throw new Exception("Failed to retrieve the input console handle.", innerException);
}
return new SafeFileHandle(handle, true);
@@ -466,7 +466,7 @@ namespace Microsoft.PowerShell.Internal
{
int err = Marshal.GetLastWin32Error();
Win32Exception innerException = new Win32Exception(err);
throw new Exception("Failed to retreive the input console handle.", innerException);
throw new Exception("Failed to retrieve the input console handle.", innerException);
}
return new SafeFileHandle(handle, true);
@@ -484,7 +484,7 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
PackageVersion = swidObject.Version,
PackageProviderName = swidObject.ProviderName,
Repository = swidObject.Source,
ExuectionStatus = swidObject.Status,
ExecutionStatus = swidObject.Status,
ExecutionTime = DateTime.Today
});
#endif
@@ -212,7 +212,7 @@ namespace Microsoft.PowerShell.Workflow
}
catch (System.Management.Automation.RuntimeException)
{
_tracer.WriteMessage("PSW Conn: Disconnected Remote Runspace is not avialable. Runspace Instance Id: " + runspaceId.ToString());
_tracer.WriteMessage("PSW Conn: Disconnected Remote Runspace is not available. Runspace Instance Id: " + runspaceId.ToString());
}
if (runspaces != null)
@@ -258,7 +258,7 @@ namespace Microsoft.PowerShell.Workflow
}
catch (PSInvalidOperationException)
{
_tracer.WriteMessage("PSW Conn: Disconnected PowerShell is not avialable. Runspace Instance Id: " + foundRunspace.InstanceId.ToString());
_tracer.WriteMessage("PSW Conn: Disconnected PowerShell is not available. Runspace Instance Id: " + foundRunspace.InstanceId.ToString());
}
finally
{
@@ -280,7 +280,7 @@ namespace Microsoft.PowerShell.Workflow
// Runspace.Close can throw exceptions when Server process has exited or runspace is invalid.
// Ignoring all exceptions.
//
_tracer.WriteMessage("PSW Conn: Disconnected PowerShell is not avialable. Runspace Instance Id: " + foundRunspace.InstanceId.ToString());
_tracer.WriteMessage("PSW Conn: Disconnected PowerShell is not available. Runspace Instance Id: " + foundRunspace.InstanceId.ToString());
}
}
}
@@ -623,7 +623,7 @@ namespace Microsoft.PowerShell.Workflow
private long LoadSerializedMetadata(object data)
{
Debug.Assert(data.GetType() == typeof (PSWorkflowContext), "The data should be of type worklfow metadata");
Debug.Assert(data.GetType() == typeof (PSWorkflowContext), "The data should be of type workflow metadata");
PSWorkflowContext metadata = (PSWorkflowContext) data;
this.serializedWorkflowParameters = Encrypt(SerializeObject(metadata.WorkflowParameters));
@@ -757,7 +757,7 @@ namespace Microsoft.PowerShell.Workflow
private ArraySegment<byte> serializedRequiredAssemblies;
private long LoadSerializedDefinition(object data)
{
Debug.Assert(data.GetType() == typeof (PSWorkflowDefinition), "The data should be of type worklfow definition");
Debug.Assert(data.GetType() == typeof (PSWorkflowDefinition), "The data should be of type workflow definition");
PSWorkflowDefinition definition = (PSWorkflowDefinition) data;
string WorkflowXaml = definition.WorkflowXaml;
@@ -782,7 +782,7 @@ namespace Microsoft.PowerShell.Workflow
private void SaveSerializedDefinition(object data)
{
Debug.Assert(data.GetType() == typeof (PSWorkflowDefinition), "The data should be of type worklfow definition");
Debug.Assert(data.GetType() == typeof (PSWorkflowDefinition), "The data should be of type workflow definition");
PSWorkflowDefinition definition = (PSWorkflowDefinition) data;
if (firstTimeStoringDefinition)
@@ -1826,7 +1826,7 @@ namespace Microsoft.PowerShell.Workflow
CreateAndEnsureInstancePath(Metadatas, out storePath);
Debug.Assert(component.GetType() == typeof(PSWorkflowContext),
"The data should be of type worklfow metadata");
"The data should be of type workflow metadata");
PSWorkflowContext metadata = (PSWorkflowContext)component;
totalBytesWritten += SerializeAndSaveToFile(metadata.WorkflowParameters, Path.Combine(storePath, Input_xml));
@@ -1841,7 +1841,7 @@ namespace Microsoft.PowerShell.Workflow
if (firstTimeStoringDefinition)
{
Debug.Assert(component.GetType() == typeof(PSWorkflowDefinition),
"The data should be of type worklfow definition");
"The data should be of type workflow definition");
PSWorkflowDefinition definition = (PSWorkflowDefinition)component;
// there is no serialization involved, just storing xamls and reference
@@ -2849,7 +2849,7 @@ namespace Microsoft.PowerShell.Activities
{
System.Management.Automation.PowerShell commandToRun = implementationContext.PowerShellInstance;
actionTracer.WriteMessage(String.Format(CultureInfo.InvariantCulture,
"Begining action to run command {0}.", commandToRun));
"Beginning action to run command {0}.", commandToRun));
if (CheckForCancel(psActivityContext)) return;
@@ -4322,7 +4322,7 @@ namespace Microsoft.PowerShell.Activities
catch (Exception)
{
// Exception setting variables, try using proxy
tracer.WriteMessage("Setting varibles in remote runspace failed using script, trying with proxy");
tracer.WriteMessage("Setting variables in remote runspace failed using script, trying with proxy");
try
{
@@ -6130,7 +6130,7 @@ namespace Microsoft.PowerShell.Activities
var authLevel = GetUbiquitousParameter<AuthenticationLevel>("PSAuthenticationLevel", parameterDefaults);
command.AddParameter("Authentication", authLevel);
Tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture,
"PowerShell activity ID={0}: Setting parameter {1} to {2} from ubiquitious parameters.",
"PowerShell activity ID={0}: Setting parameter {1} to {2} from ubiquitous parameters.",
context.ActivityInstanceId, "AuthenticationLevel", authLevel));
}
@@ -1371,7 +1371,7 @@ namespace Microsoft.PowerShell.Workflow
}
Dbg.Assert(instance.JobStateRetrieved,
"Cannot set job state when job state is not retrieved or when there is an error in retrival");
"Cannot set job state when job state is not retrieved or when there is an error in retrieval");
// igorse: set job state when job is fully restored as StateChanged event will fire
DoSetJobState(instance.State, reason);
_tracer.WriteMessage(ClassNameTrace, "RestoreFromWorkflowInstance", WorkflowGuidForTraces, this, "END");
@@ -481,7 +481,7 @@ namespace Microsoft.PowerShell.Workflow
{
//ignoring the error message and just logging them into ETW
_tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture,
"WorkflowJobSourceAdapter: Ingnoring the exception. Exception details: {0}",
"WorkflowJobSourceAdapter: Ignoring the exception. Exception details: {0}",
exception));
innerException = exception;
_structuredTracer.JobRemoveError(job.InstanceId,
@@ -499,7 +499,7 @@ namespace Microsoft.PowerShell.Workflow
{
//ignoring the error message and just logging them into ETW
_tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture,
"WorkflowJobSourceAdapter: Ingnoring the exception. Exception details: {0}",
"WorkflowJobSourceAdapter: Ignoring the exception. Exception details: {0}",
exception));
innerException = exception;
}
@@ -547,7 +547,7 @@ namespace Microsoft.PowerShell.Workflow
{
//ignoring the error message and just logging them into ETW
_tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture,
"WorkflowJobSourceAdapter: Ingnoring the exception. Exception details: {0}",
"WorkflowJobSourceAdapter: Ignoring the exception. Exception details: {0}",
exception));
_structuredTracer.JobRemoveError(job.InstanceId,
@@ -566,7 +566,7 @@ namespace Microsoft.PowerShell.Workflow
{
//ignoring the error message and just logging them into ETW
_tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture,
"WorkflowJobSourceAdapter: Ingnoring the exception. Exception details: {0}",
"WorkflowJobSourceAdapter: Ignoring the exception. Exception details: {0}",
exception));
}
job.Dispose();
@@ -904,7 +904,7 @@ namespace Microsoft.PowerShell.Workflow
"Shutting down WSMan server: Exception details: {0}",
exception));
Dbg.Assert(false, "Exception has happned during the shutdown API. [Message] " + exception.Message + "[StackTrace] " + exception.StackTrace);
Dbg.Assert(false, "Exception has happened during the shutdown API. [Message] " + exception.Message + "[StackTrace] " + exception.StackTrace);
}
}
@@ -987,7 +987,7 @@ namespace Microsoft.PowerShell.Workflow
/// <returns>Returns the collection of workflow instances.</returns>
internal IEnumerable<Job2> GetJobs(WorkflowFilterTypes type, Dictionary<string, object> filters)
{
Tracer.WriteMessage(Facility + "Geting workflow instances based on filters");
Tracer.WriteMessage(Facility + "Getting workflow instances based on filters");
return GetJobs(_wfJobTable.Values, type, filters);
}
@@ -1315,7 +1315,7 @@ namespace Microsoft.PowerShell.Workflow
}
catch (ObjectDisposedException)
{
Tracer.WriteMessage(Facility, "RemoveJob", job.PSWorkflowInstance.Id, "Worklfow Job is already disposed. so removing it.");
Tracer.WriteMessage(Facility, "RemoveJob", job.PSWorkflowInstance.Id, "Workflow Job is already disposed. so removing it.");
}
}
}
@@ -1344,7 +1344,7 @@ namespace Microsoft.PowerShell.Workflow
lock (lockObjects.GetLockObject(instanceId))
{
Tracer.WriteMessage(Facility + "Forgeting job instance with id: " + instanceId);
Tracer.WriteMessage(Facility + "Forgetting job instance with id: " + instanceId);
PSWorkflowJob job = GetJob(instanceId);
@@ -1633,7 +1633,7 @@ function __cmdletization_BindCommonParameters
methodName = "FilterByMaxPropertyValue";
break;
default:
Dbg.Assert(false, "Unrecognize query xml element");
Dbg.Assert(false, "Unrecognized query xml element");
methodName = "NotAValidMethod";
break;
}
@@ -362,7 +362,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
}
else
{
Diagnostics.Assert(false, "unknonw shape: this should never happen unless a new shape is added");
Diagnostics.Assert(false, "unknown shape: this should never happen unless a new shape is added");
return null;
}
return GetView(expressionFactory, db, t, typeNames, viewName);
@@ -1223,7 +1223,7 @@ namespace System.Management.Automation
resolvedPath = null;
CommandDiscovery.discoveryTracer.TraceError(
"The relative path with wildcard resolved to mutiple paths. {0}",
"The relative path with wildcard resolved to multiple paths. {0}",
path);
}
else
@@ -2969,7 +2969,7 @@ namespace System.Management.Automation
}
/// <summary>
/// This method is necessary becausean overridden property in a specific class derived from a generic one will
/// This method is necessary because an overridden property in a specific class derived from a generic one will
/// appear twice. The second time, it should be ignored.
/// </summary>
private static bool PropertyAlreadyPresent(List<PropertyInfo> previousProperties, PropertyInfo property)
@@ -5187,7 +5187,7 @@ namespace System.Management.Automation
Dbg.Assert(typeParameter != null, "Caller should verify typeParameter != null");
Dbg.Assert(
_typeParametersOfTheMethod.Contains(typeParameter),
"Caller should verify that typeParameter is actuall a generic type parameter of the method");
"Caller should verify that typeParameter is actually a generic type parameter of the method");
#endif
ICollection<Type> inferenceCandidates =
@@ -5284,7 +5284,7 @@ namespace System.Management.Automation
#if DEBUG
Dbg.Assert(
_typeParametersOfTheMethod.Contains(parameterType),
"Only uninstantinated generic type parameters encountered in real life, should be the ones coming from the method");
"Only uninstantiated generic type parameters encountered in real life, should be the ones coming from the method");
#endif
HashSet<Type> inferenceCandidates = _typeParameterIndexToSetOfInferenceCandidates[parameterType.GenericParameterPosition];
@@ -5722,7 +5722,7 @@ if($paths) {
Diagnostics.Assert((object)pair.Value.HelpFileName == (object)other.HelpFileName, "Pre-generated Provider help file incorrect");
Diagnostics.Assert(pair.Value.ImplementingType == other.ImplementingType, "Pre-generated Provider implementing type incorrect");
Diagnostics.Assert(string.Equals(pair.Value.Name, other.Name, StringComparison.Ordinal), "Pre-generated Provider name incorrect");
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snappin type incorrect");
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snapin type incorrect");
Diagnostics.Assert(pair.Value.Module == other.Module, "Pre-generated Provider module incorrect");
Diagnostics.Assert(pair.Value.Visibility == other.Visibility, "Pre-generated Provider visibility incorrect");
}
@@ -5741,7 +5741,7 @@ if($paths) {
Diagnostics.Assert((object)pair.Value.HelpFileName == (object)other.HelpFileName, "Pre-generated Provider help file incorrect");
Diagnostics.Assert(pair.Value.ImplementingType == other.ImplementingType, "Pre-generated Provider implementing type incorrect");
Diagnostics.Assert(string.Equals(pair.Value.Name, other.Name, StringComparison.Ordinal), "Pre-generated Provider name incorrect");
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snappin type incorrect");
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snapin type incorrect");
Diagnostics.Assert(pair.Value.Module == other.Module, "Pre-generated Provider module incorrect");
Diagnostics.Assert(pair.Value.Visibility == other.Visibility, "Pre-generated Provider visibility incorrect");
}
@@ -334,7 +334,7 @@ namespace Microsoft.PowerShell.Commands
// get the matched member(s)
ReadOnlyPSMemberInfoCollection<PSMemberInfo> members =
_inputObject.Members.Match(_propertyOrMethodName, PSMemberTypes.All);
Dbg.Assert(members != null, "The retrun value of Members.Match shoudl never be null");
Dbg.Assert(members != null, "The return value of Members.Match should never be null");
if (members.Count > 1)
{
@@ -4532,7 +4532,7 @@ namespace System.Management.Automation
delegateOwner = PSObject.AsPSObject(delegateOwner);
foreach (CollectionEntry<T> collection in Collections)
{
Diagnostics.Assert(delegateOwner != null, "all integrating collections with non emtpty collections have an associated PSObject");
Diagnostics.Assert(delegateOwner != null, "all integrating collections with non empty collections have an associated PSObject");
T memberAsT = collection.GetMember((PSObject)delegateOwner, name);
if (memberAsT != null)
{
@@ -1405,7 +1405,7 @@ namespace System.Management.Automation
/// </param>
internal void Start(Process process, NativeCommandIOFormat inputFormat)
{
Dbg.Assert(process != null, "caller should validate the paramter");
Dbg.Assert(process != null, "caller should validate the parameter");
//Get the encoding for writing to native command. Note we get the Encoding
//from the current scope so a script or function can use a different encoding
@@ -4670,7 +4670,7 @@ namespace System.Management.Automation
providerPath,
context);
s_tracer.WriteLine("sourcIsContainer = {0}", sourceIsContainer);
s_tracer.WriteLine("sourceIsContainer = {0}", sourceIsContainer);
if (sourceIsContainer)
{
@@ -358,7 +358,7 @@ namespace System.Management.Automation.Runspaces
void
SetMergeSettingsOnCommandProcessor(CommandProcessorBase commandProcessor)
{
Dbg.Assert(commandProcessor != null, "caller should valiadate the parameter");
Dbg.Assert(commandProcessor != null, "caller should validate the parameter");
MshCommandRuntime mcr = commandProcessor.Command.commandRuntime as MshCommandRuntime;
@@ -477,8 +477,8 @@ namespace System.Management.Automation.Runspaces
break;
default:
// This should never happen...
Diagnostics.Assert(false, "Invalid langage mode was set when building a ScriptCommandProcessor");
throw new InvalidOperationException("Invalid langage mode was set when building a ScriptCommandProcessor");
Diagnostics.Assert(false, "Invalid language mode was set when building a ScriptCommandProcessor");
throw new InvalidOperationException("Invalid language mode was set when building a ScriptCommandProcessor");
}
if (scriptBlock.UsesCmdletBinding)
@@ -361,7 +361,7 @@ namespace System.Management.Automation.Interpreter
if (index == _tryHandler.GotoEndTargetIndex)
{
// run the 'Goto' that jumps out of the try/catch/finally blocks
Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumpes out the try/catch/finally");
Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally");
frame.InstructionIndex += instructions[index].Run(frame);
}
}
@@ -404,7 +404,7 @@ namespace System.Management.Automation.Interpreter
if (index == _tryHandler.GotoEndTargetIndex)
{
// run the 'Goto' that jumps out of the try/catch/finally blocks
Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumpes out the try/catch/finally");
Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally");
frame.InstructionIndex += instructions[index].Run(frame);
}
}
@@ -68,7 +68,7 @@ namespace System.Management.Automation.Language
{
static CharExtensions()
{
Diagnostics.Assert(s_traits.Length == 128, "Extention methods rely on this table size.");
Diagnostics.Assert(s_traits.Length == 128, "Extension methods rely on this table size.");
}
private static readonly CharTraits[] s_traits = new CharTraits[]
@@ -10698,7 +10698,7 @@ namespace System.Management.Automation.Language
return ExtractUsingVariableImpl(memberExpr.Expression);
}
Diagnostics.Assert(false, "We should alwasy be able to get a VariableExpressionAst from a UsingExpressionAst");
Diagnostics.Assert(false, "We should always be able to get a VariableExpressionAst from a UsingExpressionAst");
return null;
}
@@ -246,7 +246,7 @@ namespace Microsoft.PowerShell.Commands
default:
{
Dbg.Assert(false, "Missing paramenter set in switch statement");
Dbg.Assert(false, "Missing parameter set in switch statement");
remoteRunspaces = new List<RemoteRunspace>(); // added to avoid prefast warning
}
break;
@@ -1098,7 +1098,7 @@ namespace System.Management.Automation.Remoting
internal PSObject DeserializeToPSObject(Stream serializedDataStream)
{
Dbg.Assert(null != serializedDataStream, "Cannot Deserialize null data");
Dbg.Assert(serializedDataStream.Length != 0, "Cannot Deserialze empty data");
Dbg.Assert(serializedDataStream.Length != 0, "Cannot Deserialize empty data");
object result = null;
using (XmlReader xmlReader = XmlReader.Create(serializedDataStream, InternalDeserializer.XmlReaderSettingsForCliXml))
@@ -624,32 +624,32 @@ namespace System.Management.Automation.Remoting
}
catch (ArgumentException e)
{
s_tracer.TraceWarning("Not able to change curent working directory to {0}: {1}",
s_tracer.TraceWarning("Not able to change current working directory to {0}: {1}",
applicationBase, e.Message);
}
catch (PathTooLongException e)
{
s_tracer.TraceWarning("Not able to change curent working directory to {0}: {1}",
s_tracer.TraceWarning("Not able to change current working directory to {0}: {1}",
applicationBase, e.Message);
}
catch (FileNotFoundException e)
{
s_tracer.TraceWarning("Not able to change curent working directory to {0}: {1}",
s_tracer.TraceWarning("Not able to change current working directory to {0}: {1}",
applicationBase, e.Message);
}
catch (IOException e)
{
s_tracer.TraceWarning("Not able to change curent working directory to {0}: {1}",
s_tracer.TraceWarning("Not able to change current working directory to {0}: {1}",
applicationBase, e.Message);
}
catch (System.Security.SecurityException e)
{
s_tracer.TraceWarning("Not able to change curent working directory to {0}: {1}",
s_tracer.TraceWarning("Not able to change current working directory to {0}: {1}",
applicationBase, e.Message);
}
catch (UnauthorizedAccessException e)
{
s_tracer.TraceWarning("Not able to change curent working directory to {0}: {1}",
s_tracer.TraceWarning("Not able to change current working directory to {0}: {1}",
applicationBase, e.Message);
}
}
@@ -692,7 +692,7 @@ namespace System.Management.Automation.Remoting
runspacepoolInitData.Serialize(stream, fragmentor);
stream.Exit();
byte[] outbuffer = stream.Read();
Dbg.Assert(outbuffer != null, "connet response data should be serialized");
Dbg.Assert(outbuffer != null, "connect response data should be serialized");
stream.Dispose();
//we are done
connectResponseData = outbuffer;
@@ -457,7 +457,7 @@ namespace System.Management.Automation.Remoting
throw PSTraceSource.NewArgumentNullException("fsmEventArg");
}
Dbg.Assert(_state == RemoteSessionState.NegotiationSent, "State must be NeogtiationReceived");
Dbg.Assert(_state == RemoteSessionState.NegotiationSent, "State must be NegotiationReceived");
Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.NegotiationCompleted, "StateEvent must be NegotiationCompleted");
if (fsmEventArg.StateEvent != RemoteSessionEvent.NegotiationCompleted)
@@ -921,7 +921,7 @@ namespace System.Management.Automation.Remoting
//***TODO*** Deal with this on the client side. Key exchange packets should have additional information
//that identify the context of negotiation. Just like callId in SetMax and SetMinRunspaces messages
Dbg.Assert(_state >= RemoteSessionState.Established,
"Key Receving can only be raised after reaching the Established state");
"Key Receiving can only be raised after reaching the Established state");
switch (eventArgs.StateEvent)
{
@@ -714,7 +714,7 @@ namespace System.Management.Automation
else
{
// If this assertion fires, the command name is determined incorrectly.
Diagnostics.Assert(commandNameAst is CommandParameterAst, "Unxpected element not handled correctly.");
Diagnostics.Assert(commandNameAst is CommandParameterAst, "Unexpected element not handled correctly.");
commandName = commandNameAst.Extent.Text;
}
@@ -739,7 +739,7 @@ namespace System.Management.Automation
// Process the contents of a splatted variable into the arguments for this
// command. If the variable contains a hashtable, distribute the key/value pairs
// If it's an enumberable, then distribute the values as $args and finally
// If it's an enumerable, then distribute the values as $args and finally
// if it's a scalar, then the effect is equivalent to $var
object splattedValue = _context.GetVariableValue(variableAst.VariablePath);
foreach (var splattedParameter in PipelineOps.Splat(splattedValue, variableAst.Extent))
@@ -1032,7 +1032,7 @@ namespace System.Management.Automation.Internal
} // if (rsa != null...
else
{
Dbg.Assert(false, "Session key not availble to encrypt secure string");
Dbg.Assert(false, "Session key not available to encrypt secure string");
}
return encryptedDataAsString;
@@ -1392,7 +1392,7 @@ namespace System.Management.Automation.Internal
/// <returns></returns>
internal bool ImportEncryptedSessionKey(string encryptedSessionKey)
{
Dbg.Assert(!String.IsNullOrEmpty(encryptedSessionKey), "encrypted sessoin key passed in cannot be null");
Dbg.Assert(!String.IsNullOrEmpty(encryptedSessionKey), "encrypted session key passed in cannot be null");
try
{