From ec0eb220626c5d30e8feeb1e9519d028fe67e906 Mon Sep 17 00:00:00 2001 From: spaette <111918424+spaette@users.noreply.github.com> Date: Thu, 2 Feb 2023 23:40:43 -0600 Subject: [PATCH] Fix typos in comments (#19064) --- assets/wix/Product.wxs | 2 +- .../HelpWindow/ParagraphBuilder.cs | 6 +++--- .../HelpWindow/ParagraphSearcher.cs | 12 ++++++------ .../ViewModel/AllModulesViewModel.cs | 2 +- .../management/GetComputerInfoCommand.cs | 2 +- .../Common/WebRequestPSCmdlet.Common.cs | 10 +++++----- .../host/msh/ConsoleControl.cs | 2 +- .../host/msh/PendingProgress.cs | 2 +- src/Microsoft.WSMan.Management/WsManHelper.cs | 4 ++-- .../resources/WsManResources.resx | 2 +- .../resources/WsManResources.txt | 2 +- .../CoreCLR/CorePsPlatform.cs | 2 +- .../common/FormatViewGenerator.cs | 4 ++-- .../common/FormatViewGenerator_Complex.cs | 2 +- .../common/FormattingObjects.cs | 2 +- .../FormatAndOutput/common/ILineOutput.cs | 2 +- .../engine/ComInterop/IDispatchComObject.cs | 2 +- .../engine/ComInterop/VarEnumSelector.cs | 2 +- .../CommandCompletion/CompletionCompleters.cs | 4 ++-- .../engine/CoreAdapter.cs | 2 +- .../engine/ExtendedTypeSystemException.cs | 18 +++++++++--------- .../engine/GetCommandCommand.cs | 2 +- .../engine/InitialSessionState.cs | 4 ++-- .../engine/Interop/Windows/QueryDosDevice.cs | 2 +- .../engine/Modules/ModuleCmdletBase.cs | 2 +- .../engine/Modules/ModuleIntrinsics.cs | 2 +- .../engine/Modules/ModuleSpecification.cs | 2 +- .../engine/NativeCommandParameterBinder.cs | 2 +- .../engine/ParameterBinderBase.cs | 2 +- .../engine/ParameterBinderController.cs | 2 +- .../engine/SessionStateContainer.cs | 2 +- .../engine/debugger/debugger.cs | 4 ++-- .../engine/hostifaces/ConnectionBase.cs | 2 +- .../hostifaces/InternalHostUserInterface.cs | 2 +- .../engine/hostifaces/LocalConnection.cs | 2 +- .../engine/lang/scriptblock.cs | 2 +- .../engine/parser/Compiler.cs | 4 ++-- .../engine/parser/Parser.cs | 2 +- .../engine/parser/tokenizer.cs | 2 +- .../engine/pipeline.cs | 2 +- .../remoting/commands/CustomShellCommands.cs | 16 ++++++++-------- .../remoting/commands/remotingcommandutil.cs | 2 +- .../fanin/InitialSessionStateProvider.cs | 2 +- .../engine/runtime/Binding/Binders.cs | 4 ++-- .../engine/runtime/Operations/MiscOps.cs | 2 +- .../help/AliasHelpProvider.cs | 4 ++-- .../help/ProviderContext.cs | 2 +- .../help/UpdatableHelpSystem.cs | 14 +++++++------- .../namespaces/FileSystemContentStream.cs | 2 +- .../namespaces/FileSystemProvider.cs | 2 +- .../namespaces/FileSystemSecurity.cs | 2 +- .../namespaces/RegistryProvider.cs | 4 ++-- .../security/CatalogHelper.cs | 4 ++-- .../security/SecurityManager.cs | 2 +- .../utils/MetadataExceptions.cs | 8 ++++---- .../utils/tracing/PSEtwLogProvider.cs | 2 +- src/TypeCatalogGen/TypeCatalogGen.cs | 2 +- test/hosting/test_HostingBasic.cs | 2 +- test/perf/benchmarks/Engine.Compiler.cs | 2 +- test/perf/benchmarks/Engine.ScriptBlock.cs | 2 +- .../PerfLabExporter.cs | 2 +- .../RecommendedConfig.cs | 2 +- .../TooManyTestCasesValidator.cs | 2 +- 63 files changed, 108 insertions(+), 108 deletions(-) diff --git a/assets/wix/Product.wxs b/assets/wix/Product.wxs index 3a8977e83f..54979ecb51 100644 --- a/assets/wix/Product.wxs +++ b/assets/wix/Product.wxs @@ -222,7 +222,7 @@ - ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs index 92c0de12cd..79c53d04ce 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs @@ -12,8 +12,8 @@ namespace Microsoft.Management.UI.Internal { /// /// Builds a paragraph based on Text + Bold + Highlight information. - /// Bold are the segments of thexct that should be bold, and Highlight are - /// the segments of thext that should be highlighted (like search results). + /// Bold are the segments of the text that should be bold, and Highlight are + /// the segments of the text that should be highlighted (like search results). /// internal class ParagraphBuilder : INotifyPropertyChanged { @@ -264,7 +264,7 @@ namespace Microsoft.Management.UI.Internal } // there is no span ending ahead of current position, so - // we set the current span to null to prevent unecessary comparisons against the currentSpan + // we set the current span to null to prevent unnecessary comparisons against the currentSpan currentSpan = null; } diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs index 9ba8f158a2..c8b9907751 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs @@ -43,8 +43,8 @@ namespace Microsoft.Management.UI.Internal /// The next highlight starting at the . 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; @@ -59,7 +59,7 @@ namespace Microsoft.Management.UI.Internal // It has to be in the end because if there is a match at the beginning of the file // and the caret has not been touched (so it is in the beginning of the file too) // we want to highlight this first match. - // Considering the caller allways set the caret to the end of the highlight + // Considering the caller always set the caret to the end of the highlight // The condition below works well for successive searchs // We also need to move to the adjacent run if the caret is at the first run and we // are moving backwards so that a search backwards when the first run is highlighted @@ -78,7 +78,7 @@ namespace Microsoft.Management.UI.Internal if (currentRun == null) { - // if we could not find a next highlight wrap arround + // if we could not find a next highlight wraparound currentRun = ParagraphSearcher.GetFirstOrLastRun(caretRun, forward); currentRun = ParagraphSearcher.GetNextMatch(currentRun, forward); } @@ -86,7 +86,7 @@ namespace Microsoft.Management.UI.Internal this.currentHighlightedMatch = currentRun; if (this.currentHighlightedMatch != null) { - // restore the curent highligthed background to current highlighted + // restore the curent highlighted background to current highlighted this.currentHighlightedMatch.Background = ParagraphSearcher.CurrentHighlightBrush; } @@ -221,7 +221,7 @@ namespace Microsoft.Management.UI.Internal /// The first or last run in the paragraph containing . 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); diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs index d2899b994d..04fc95e422 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs @@ -529,7 +529,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal return; } - // If there are more modules, create an additional module to agregate all commands + // If there are more modules, create an additional module to aggregate all commands ModuleViewModel allCommandsModule = new ModuleViewModel(ShowCommandResources.All, null); this.modules.Add(allCommandsModule); allCommandsModule.SetAllModules(this); diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs index 02f13f1dd8..3de7c72374 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs @@ -1190,7 +1190,7 @@ namespace Microsoft.PowerShell.Commands /// /// /// A Nullable enum object. If the value - /// is convertable to a valid enum value, the returned object's + /// is convertible to a valid enum value, the returned object's /// value will contain the converted value, otherwise the returned /// object will be null. /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs index c267ad81f8..7e991eece0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs @@ -1565,7 +1565,7 @@ namespace Microsoft.PowerShell.Commands /// The WebRequest who's content is to be set. /// A byte array containing the content data. /// - /// Because this function sets the request's ContentLength property and writes content data into the requests's stream, + /// Because this function sets the request's ContentLength property and writes content data into the request's stream, /// it should be called one time maximum on a given request. /// internal void SetRequestContent(HttpRequestMessage request, byte[] content) @@ -1583,7 +1583,7 @@ namespace Microsoft.PowerShell.Commands /// The WebRequest who's content is to be set. /// A String object containing the content data. /// - /// Because this function sets the request's ContentLength property and writes content data into the requests's stream, + /// Because this function sets the request's ContentLength property and writes content data into the request's stream, /// it should be called one time maximum on a given request. /// internal void SetRequestContent(HttpRequestMessage request, string content) @@ -1650,7 +1650,7 @@ namespace Microsoft.PowerShell.Commands /// The WebRequest who's content is to be set. /// A Stream object containing the content data. /// - /// Because this function sets the request's ContentLength property and writes content data into the requests's stream, + /// Because this function sets the request's ContentLength property and writes content data into the request's stream, /// it should be called one time maximum on a given request. /// internal void SetRequestContent(HttpRequestMessage request, Stream contentStream) @@ -1668,7 +1668,7 @@ namespace Microsoft.PowerShell.Commands /// The WebRequest who's content is to be set. /// A MultipartFormDataContent object containing multipart/form-data content. /// - /// Because this function sets the request's ContentLength property and writes content data into the requests's stream, + /// Because this function sets the request's ContentLength property and writes content data into the request's stream, /// it should be called one time maximum on a given request. /// internal void SetRequestContent(HttpRequestMessage request, MultipartFormDataContent multipartContent) @@ -1775,7 +1775,7 @@ namespace Microsoft.PowerShell.Commands { foreach (var item in items) { - // Recruse, but do not enumerate the next level. IEnumerables will be treated as single values. + // Recurse, but do not enumerate the next level. IEnumerables will be treated as single values. AddMultipartContent(fieldName: fieldName, fieldValue: item, formData: formData, enumerate: false); } } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 43eb27b86e..8857c64fa5 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -2799,7 +2799,7 @@ namespace Microsoft.PowerShell ((uint)(c - 0xffe0) <= (0xffe6 - 0xffe0))); // We can ignore these ranges because .Net strings use surrogate pairs - // for this range and we do not handle surrogage pairs. + // for this range and we do not handle surrogate pairs. // (c >= 0x20000 && c <= 0x2fffd) || // (c >= 0x30000 && c <= 0x3fffd) return 1 + (isWide ? 1 : 0); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs index 8453ad6507..7f1a5ad7e1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs @@ -573,7 +573,7 @@ namespace Microsoft.PowerShell int invisible = 0; if (TallyHeight(rawUI, maxHeight, maxWidth) > maxHeight) { - // This will smash down nodes until the tree will fit into the alloted number of lines. If in the + // This will smash down nodes until the tree will fit into the allotted number of lines. If in the // process some nodes were made invisible, we will add a line to the display to say so. invisible = CompressToFit(rawUI, maxHeight, maxWidth); diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index ce76f35af6..83b1f0a72a 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -615,7 +615,7 @@ namespace Microsoft.WSMan.Management if ((credential != null) && (certificateThumbprint != null)) { string message = FormatResourceMsgFromResourcetextS( - "AmbiguosAuthentication", + "AmbiguousAuthentication", "CertificateThumbPrint", "credential"); throw new InvalidOperationException(message); @@ -626,7 +626,7 @@ namespace Microsoft.WSMan.Management (certificateThumbprint != null)) { string message = FormatResourceMsgFromResourcetextS( - "AmbiguosAuthentication", + "AmbiguousAuthentication", "CertificateThumbPrint", authentication.ToString()); throw new InvalidOperationException(message); diff --git a/src/Microsoft.WSMan.Management/resources/WsManResources.resx b/src/Microsoft.WSMan.Management/resources/WsManResources.resx index c55aab1132..a25f6c4801 100644 --- a/src/Microsoft.WSMan.Management/resources/WsManResources.resx +++ b/src/Microsoft.WSMan.Management/resources/WsManResources.resx @@ -191,7 +191,7 @@ Do you want to enable CredSSP authentication? This command cannot be used because the parameter matches a non-text property on the ResourceURI.Check the input parameters and run your command. - + A {0} cannot be specified when {1} is specified. diff --git a/src/Microsoft.WSMan.Management/resources/WsManResources.txt b/src/Microsoft.WSMan.Management/resources/WsManResources.txt index 50cf1bf1fe..10702e5cce 100644 --- a/src/Microsoft.WSMan.Management/resources/WsManResources.txt +++ b/src/Microsoft.WSMan.Management/resources/WsManResources.txt @@ -56,7 +56,7 @@ CredSSPServiceConfigured=This computer is configured to receive credentials from CredSSPServiceNotConfigured=This computer is not configured to receive credentials from a remote client computer. QuickConfigContinueCaption=WinRM Quick Configuration QuickConfigContinueQuery=Running the Set-WSManQuickConfig command has significant security implications, as it enables remote management through the WinRM service on this computer.\nThis command:\n 1. Checks whether the WinRM service is running. If the WinRM service is not running, the service is started.\n 2. Sets the WinRM service startup type to automatic.\n 3. Creates a listener to accept requests on any IP address. By default, the transport is HTTP.\n 4. Enables a firewall exception for WS-Management traffic.\n 5. Enables Kerberos and Negotiate service authentication.\nDo you want to enable remote management through the WinRM service on this computer? -AmbiguosAuthentication=A {0} cannot be specified when {1} is specified. +AmbiguousAuthentication=A {0} cannot be specified when {1} is specified. CmdletNotAvailable=This PowerShell cmdlet is not available on for Windows XP and Windows Server 2003. InvalidValueType=This command cannot be used because the parameter value type is invalid. {0} configuration expects a value of Type {1}. Verify that the value is correct and try again. ClearItemOnRunAsPassword=The RunAsPassword value cannot be removed. Remove the values for RunAsUser and RunAsPassword in PowerShell by calling the Clear-Item cmdlet with the value for -Path attribute equal to the value of RunAsUser. diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 78b355ab3f..81b0e624dd 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -898,7 +898,7 @@ namespace System.Management.Automation private const string psLib = "libpsl-native"; // Ansi is a misnomer, it is hardcoded to UTF-8 on Linux and macOS - // C bools are 1 byte and so must be marshaled as I1 + // C bools are 1 byte and so must be marshalled as I1 [LibraryImport(psLib)] internal static partial int GetErrorCategory(int errno); diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs index f29033e3c8..41c4dafe85 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs @@ -219,7 +219,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format if (formatErrorObject != null && formatErrorObject.exception != null) { - // if we did no thave any errors in the expression evaluation + // if we did not have any errors in the expression evaluation // we might have errors in the formatting, if present _errorManager.LogStringFormatError(formatErrorObject); if (_errorManager.DisplayFormatErrorString) @@ -387,7 +387,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } else if (formatErrorObject != null && formatErrorObject.exception != null) { - // if we did no thave any errors in the expression evaluation + // if we did not have any errors in the expression evaluation // we might have errors in the formatting, if present _errorManager.LogStringFormatError(formatErrorObject); if (_errorManager.DisplayErrorStrings) diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs index cae35b7b28..5573c28f78 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs @@ -491,7 +491,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format if (formatErrorObject != null && formatErrorObject.exception != null) { - // if we did no thave any errors in the expression evaluation + // if we did not have any errors in the expression evaluation // we might have errors in the formatting, if present _errorManager.LogStringFormatError(formatErrorObject); if (_errorManager.DisplayFormatErrorString) diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs index 6c999ae33e..4af1ee54d8 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs @@ -18,7 +18,7 @@ // representation that mig have been introduced by serialization. // // There is also the need to preserve type information across serialization -// boundaries, therefore the objects provide a GUID based machanism to +// boundaries, therefore the objects provide a GUID based mechanism to // preserve the information. // diff --git a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs index 3c20066463..7bca25ea82 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs @@ -137,7 +137,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format ((uint)(c - 0xffe0) <= (0xffe6 - 0xffe0))); // We can ignore these ranges because .Net strings use surrogate pairs - // for this range and we do not handle surrogage pairs. + // for this range and we do not handle surrogate pairs. // (c >= 0x20000 && c <= 0x2fffd) || // (c >= 0x30000 && c <= 0x3fffd) return 1 + (isWide ? 1 : 0); diff --git a/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs b/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs index 6ce8647656..7c2a3c106a 100644 --- a/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs @@ -22,7 +22,7 @@ namespace System.Management.Automation.ComInterop /// default arguments?). So obj.foo() is ambiguous as it could mean invoking method foo, /// or it could mean invoking the function pointer returned by property foo. /// We are attempting to find whether we need to call a method or a property by examining - /// the ITypeInfo associated with the IDispatch. ITypeInfo tell's use what parameters the method + /// the ITypeInfo associated with the IDispatch. ITypeInfo tells us what parameters the method /// expects, is it a method or a property, what is the default property of the object, how to /// create an enumerator for collections etc. /// diff --git a/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs b/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs index 942a636443..bbe65d0a6e 100644 --- a/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs +++ b/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs @@ -455,7 +455,7 @@ namespace System.Management.Automation.ComInterop if (elementType == typeof(object) || elementType == typeof(DBNull)) { //no meaningful value to pass ByRef. - //perhaps the calee will replace it with something. + //perhaps the callee will replace it with something. //need to pass as a variant reference elementVarEnum = VarEnum.VT_VARIANT; } diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index ca4cc4ec1d..9b10aa31ea 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -2028,7 +2028,7 @@ namespace System.Management.Automation string parameterName = parameter.Name; // Fall back to the commandAst command name if a command name is not found. This can be caused by a script block or AST with the matching function definition being passed to CompleteInput - // This allows for editors and other tools using CompleteInput with Script/AST definations to get values from RegisteredArgumentCompleters to better match the console experience. + // This allows for editors and other tools using CompleteInput with Script/AST definitions to get values from RegisteredArgumentCompleters to better match the console experience. // See issue https://github.com/PowerShell/PowerShell/issues/10567 string actualCommandName = string.IsNullOrEmpty(commandName) ? commandAst.GetCommandName() @@ -4618,7 +4618,7 @@ namespace System.Management.Automation } catch (Exception) { - // The object at the specified path is not accessable, such as c:\hiberfil.sys (for hibernation) or c:\pagefile.sys (for paging) + // The object at the specified path is not accessible, such as c:\hiberfil.sys (for hibernation) or c:\pagefile.sys (for paging) // We ignore those files continue; } diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index 0bda9ee906..55486c674a 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -2230,7 +2230,7 @@ namespace System.Management.Automation // be thrown when converting arguments to the ByRef-like parameter types. // // So when reaching here, we only care about (1) if the method return type is - // BeRef-like; (2) if it's a constrcutor of a ByRef-like type. + // BeRef-like; (2) if it's a constructor of a ByRef-like type. if (method is ConstructorInfo ctor) { diff --git a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs index 9ed85accb4..854482e3f6 100644 --- a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs +++ b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs @@ -36,7 +36,7 @@ namespace System.Management.Automation /// Initializes a new instance of ExtendedTypeSystemException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public ExtendedTypeSystemException(string message, Exception innerException) : base(message, innerException) { @@ -112,7 +112,7 @@ namespace System.Management.Automation /// Initializes a new instance of MethodException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public MethodException(string message, Exception innerException) : base(message, innerException) { @@ -183,7 +183,7 @@ namespace System.Management.Automation /// Initializes a new instance of MethodInvocationException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public MethodInvocationException(string message, Exception innerException) : base(message, innerException) { @@ -252,7 +252,7 @@ namespace System.Management.Automation /// Initializes a new instance of GetValueException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public GetValueException(string message, Exception innerException) : base(message, innerException) { @@ -319,7 +319,7 @@ namespace System.Management.Automation /// Initializes a new instance of GetValueException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public PropertyNotFoundException(string message, Exception innerException) : base(message, innerException) { @@ -388,7 +388,7 @@ namespace System.Management.Automation /// Initializes a new instance of GetValueInvocationException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public GetValueInvocationException(string message, Exception innerException) : base(message, innerException) { @@ -455,7 +455,7 @@ namespace System.Management.Automation /// Initializes a new instance of SetValueException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public SetValueException(string message, Exception innerException) : base(message, innerException) { @@ -522,7 +522,7 @@ namespace System.Management.Automation /// Initializes a new instance of SetValueInvocationException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public SetValueInvocationException(string message, Exception innerException) : base(message, innerException) { @@ -617,7 +617,7 @@ namespace System.Management.Automation /// Initializes a new instance of PSInvalidCastException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public PSInvalidCastException(string message, Exception innerException) : base(message, innerException) { diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index 81675d7b66..9784cdc9ea 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -564,7 +564,7 @@ namespace Microsoft.PowerShell.Commands // No telemetry here - capturing the name of a command which we are not familiar with // may be confidential customer information - // We want telementry on commands people look for but don't exist - this should give us an idea + // We want telemetry on commands people look for but don't exist - this should give us an idea // what sort of commands people expect but either don't exist, or maybe should be installed by default. // The StartsWith is to avoid logging telemetry when suggestion mode checks the // current directory for scripts/exes in the current directory and '.' is not in the path. diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 78f6c0af98..31b8f549b4 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -2434,7 +2434,7 @@ namespace System.Management.Automation.Runspaces } // Specify the source only if this is for module loading. - // The source is used for porper cleaning of the assembly cache when a module is unloaded. + // The source is used for proper cleaning of the assembly cache when a module is unloaded. Assembly asm = context.AddAssembly(ssae.Module?.Name, ssae.Name, ssae.FileName, out Exception error); if (asm == null || error != null) @@ -4753,7 +4753,7 @@ end { SessionStateFunctionEntry.GetDelayParsedFunctionEntry("cd..", "Set-Location ..", isProductCode: true, languageMode: systemLanguageMode), SessionStateFunctionEntry.GetDelayParsedFunctionEntry("cd\\", "Set-Location \\", isProductCode: true, languageMode: systemLanguageMode), SessionStateFunctionEntry.GetDelayParsedFunctionEntry("cd~", "Set-Location ~", isProductCode: true, languageMode: systemLanguageMode), - // Win8: 320909. Retaining the original definition to ensure backward compatability. + // Win8: 320909. Retaining the original definition to ensure backward compatibility. SessionStateFunctionEntry.GetDelayParsedFunctionEntry("Pause", string.Concat("$null = Read-Host '", CodeGeneration.EscapeSingleQuotedStringContent(RunspaceInit.PauseDefinitionString), "'"), isProductCode: true, languageMode: systemLanguageMode), SessionStateFunctionEntry.GetDelayParsedFunctionEntry("help", GetHelpPagingFunctionText(), isProductCode: true, languageMode: systemLanguageMode), diff --git a/src/System.Management.Automation/engine/Interop/Windows/QueryDosDevice.cs b/src/System.Management.Automation/engine/Interop/Windows/QueryDosDevice.cs index 419a4ef127..27907bd013 100644 --- a/src/System.Management.Automation/engine/Interop/Windows/QueryDosDevice.cs +++ b/src/System.Management.Automation/engine/Interop/Windows/QueryDosDevice.cs @@ -41,7 +41,7 @@ internal static partial class Interop { if (buffer.StartsWith("\\??\\")) { - // QueryDosDevice always return array of NULL-terinating strings with additional final NULL + // QueryDosDevice always return array of NULL-terminating strings with additional final NULL // so the buffer has always two NULL-s on end. // // "\\??\\UNC\\localhost\\c$\\tmp\0\0" -> "UNC\\localhost\\c$\\tmp\0\0" diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index b17d3628aa..f476fe6eb8 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -714,7 +714,7 @@ namespace Microsoft.PowerShell.Commands if (string.IsNullOrEmpty(rootedPath)) { // Use the name of the parent module if it's specified, otherwise, use the current module name. - // - If the current module is a nested module, then the parent module will be specifeid. + // - If the current module is a nested module, then the parent module will be specified. // - If the current module is a root module, then the parent module will not be specified. string moduleName = parentModule?.Name ?? ModuleIntrinsics.GetModuleName(moduleSpecification.Name); rootedPath = FixFileName(moduleName, moduleBase, moduleSpecification.Name, extension: null, canLoadAssembly: importingModule); diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index 50170b6342..f15a567d65 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -1148,7 +1148,7 @@ namespace System.Management.Automation } else if (insertPosition > result.Length) { - // handle case where path is a singleton with no path seperator already + // handle case where path is a singleton with no path separator already result.Append(Path.PathSeparator).Append(subPathToAdd); } else // insert at the requested location (this is used by DSC ( location) and by 'user-specific location' (SpecialFolder.MyDocuments or EVT.User)) diff --git a/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs b/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs index b539b19190..a89837b3da 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs @@ -127,7 +127,7 @@ namespace Microsoft.PowerShell.Commands } } // catch all exceptions here, we are going to report them via return value. - // Example of catched exception: one of conversions to Version failed. + // Example of caught exception: one of conversions to Version failed. catch (Exception e) { return e; diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs index 567a00387d..104414f1fb 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs @@ -201,7 +201,7 @@ namespace System.Management.Automation } catch { - // The value is not convertable send back Legacy + // The value is not convertible send back Legacy return NativeArgumentPassingStyle.Legacy; } } diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index e190c4aaca..d087d5900e 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -1447,7 +1447,7 @@ namespace System.Management.Automation /// could not be created. /// [SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode")] - [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Consider Simplyfing it")] + [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Consider Simplifying it")] private object EncodeCollection( CommandParameterInternal argument, string parameterName, diff --git a/src/System.Management.Automation/engine/ParameterBinderController.cs b/src/System.Management.Automation/engine/ParameterBinderController.cs index 931dc24d55..f9781a9943 100644 --- a/src/System.Management.Automation/engine/ParameterBinderController.cs +++ b/src/System.Management.Automation/engine/ParameterBinderController.cs @@ -616,7 +616,7 @@ namespace System.Management.Automation { // This named parameter from splatting is also explicitly specified by the user, // which was successfully bound, so we ignore the one from splatting because it - // is superceded by the explicit one. For example: + // is superseded by the explicit one. For example: // $splat = @{ Path = $path1 } // dir @splat -Path $path2 continue; diff --git a/src/System.Management.Automation/engine/SessionStateContainer.cs b/src/System.Management.Automation/engine/SessionStateContainer.cs index 8a070caec8..1438671e1e 100644 --- a/src/System.Management.Automation/engine/SessionStateContainer.cs +++ b/src/System.Management.Automation/engine/SessionStateContainer.cs @@ -1497,7 +1497,7 @@ namespace System.Management.Automation // include and exclude filters try { - // Temeporary set literal path as false to apply filter + // Temporary set literal path as false to apply filter context.SuppressWildcardExpansion = false; ProcessPathItems(providerInstance, path, recurse, depth, context, out _, ProcessMode.Enumerate); } diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index c84d6a4829..2d154bec0f 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -2129,7 +2129,7 @@ namespace System.Management.Automation { get { - // The debugger can be disbled if there are no breakpoints + // The debugger can be disabled if there are no breakpoints // left and if we are not currently stepping in the debugger. return _idToBreakpoint.IsEmpty && _currentDebuggerAction != DebuggerResumeAction.StepInto && @@ -3539,7 +3539,7 @@ namespace System.Management.Automation else if ((command.Commands.Count > 0) && (command.Commands[0].CommandText.IndexOf(".EnterNestedPrompt()", StringComparison.OrdinalIgnoreCase) > 0)) { - // Prevent a host EnterNestedPrompt() call from occuring in an active debugger. + // Prevent a host EnterNestedPrompt() call from occurring in an active debugger. // Host nested prompt makes no sense in this case and can cause host to stop responding depending on host implementation. throw new PSNotSupportedException(); } diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs index ca3847cc59..64ca4956e0 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs @@ -263,7 +263,7 @@ namespace System.Management.Automation.Runspaces if (etwEnabled) RunspaceEventSource.Log.OpenRunspaceStop(); #if LEGACYTELEMETRY - // We report startup telementry when opening the runspace - because this is the first time + // We report startup telemetry when opening the runspace - because this is the first time // we are really using PowerShell. This isn't the cleanest place though, because // sometimes there are many runspaces created - the callee ensures telemetry is only // reported once. Note that if the host implements IHostProvidesTelemetryData, we rely diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs index b9c1f5df8b..94a25726f7 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs @@ -495,7 +495,7 @@ namespace System.Management.Automation.Internal.Host break; case 3: - // No to All means that we want to stop everytime WriteDebug is called. Since No throws an error, I + // No to All means that we want to stop every time WriteDebug is called. Since No throws an error, I // think that ordinarily, the caller will terminate. So I don't think the caller will ever get back // calling WriteDebug again, and thus "No to All" might not be a useful option to have. diff --git a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs index e640e6f112..476502c7e3 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs @@ -1512,7 +1512,7 @@ namespace System.Management.Automation.Runspaces /// Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public RunspaceOpenModuleLoadException(string message, Exception innerException) : base(message, innerException) { diff --git a/src/System.Management.Automation/engine/lang/scriptblock.cs b/src/System.Management.Automation/engine/lang/scriptblock.cs index cc2f8ef913..c00fb9d6e3 100644 --- a/src/System.Management.Automation/engine/lang/scriptblock.cs +++ b/src/System.Management.Automation/engine/lang/scriptblock.cs @@ -1359,7 +1359,7 @@ namespace System.Management.Automation /// Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public ScriptBlockToPowerShellNotSupportedException(string message, Exception innerException) : base(message, innerException) { diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index cfe4c60dea..a262ec520a 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -435,8 +435,8 @@ namespace System.Management.Automation.Language internal static readonly MethodInfo PSInvokeMemberBinder_IsHeterogeneousArray = typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHeterogeneousArray), StaticFlags); - internal static readonly MethodInfo PSInvokeMemberBinder_IsHomogenousArray = - typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogenousArray), StaticFlags); + internal static readonly MethodInfo PSInvokeMemberBinder_IsHomogeneousArray = + typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.IsHomogeneousArray), StaticFlags); internal static readonly MethodInfo PSInvokeMemberBinder_TryGetInstanceMethod = typeof(PSInvokeMemberBinder).GetMethod(nameof(PSInvokeMemberBinder.TryGetInstanceMethod), StaticFlags); diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index f110845afd..e1788d5996 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -5750,7 +5750,7 @@ namespace System.Management.Automation.Language // just look for pipelines as before. RuntimeHelpers.EnsureSufficientExecutionStack(); - // First look for assignment, since PipelineRule once handled that and this supercedes that. + // First look for assignment, since PipelineRule once handled that and this supersedes that. // We may end up with an expression here as a result, // in which case we hang on to it to pass it into the first pipeline rule call. Token assignToken = null; diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index 9e133016e8..c0c150cdd4 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -2563,7 +2563,7 @@ namespace System.Management.Automation.Language // Make sure we didn't consume anything because we didn't find // any nested tokens (no variable or subexpression.) - Diagnostics.Assert(PeekChar() == c1, "We accidently consumed a character we shouldn't have."); + Diagnostics.Assert(PeekChar() == c1, "We accidentally consumed a character we shouldn't have."); return false; } diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index 3373b5e56f..dba038f91b 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -1040,7 +1040,7 @@ namespace System.Management.Automation.Internal } // We want the value of PSDefaultParameterValues before possibly changing to the commands scopes. - // This ensures we use the value from the callers scope, not the callees scope. + // This ensures we use the value from the caller's scope, not the callee's scope. IDictionary psDefaultParameterValues = firstcommandProcessor.Context.GetVariableValue(SpecialVariables.PSDefaultParameterValuesVarPath, false) as IDictionary; diff --git a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs index 811707a3b5..e4424fd8c9 100644 --- a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs +++ b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs @@ -348,7 +348,7 @@ else string localSDDL = GetLocalSddl(); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. string newPluginSbString = string.Format(CultureInfo.InvariantCulture, newPluginSbFormat, WSManNativeApi.ResourceURIPrefix, localSDDL, RemoteManagementUsersSID, InteractiveUsersSID); @@ -2618,7 +2618,7 @@ else removePluginSbFormat, RemotingConstants.PSPluginDLLName); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_removePluginSb = ScriptBlock.Create(removePluginScript); s_removePluginSb.LanguageMode = PSLanguageMode.FullLanguage; } @@ -2834,7 +2834,7 @@ $args[0] | ForEach-Object {{ PSSessionConfigurationCommandUtilities.PSCustomShellTypeName, RemotingConstants.PSPluginDLLName); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_getPluginSb = ScriptBlock.Create(scriptToRun); s_getPluginSb.LanguageMode = PSLanguageMode.FullLanguage; } @@ -3258,7 +3258,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5] RemotingConstants.PSPluginDLLName, localSDDL, RemoteManagementUsersSID, InteractiveUsersSID); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_setPluginSb = ScriptBlock.Create(setPluginScript); s_setPluginSb.LanguageMode = PSLanguageMode.FullLanguage; } @@ -4208,7 +4208,7 @@ $_ | Enable-PSSessionConfiguration -force $args[0] -sddl $args[1] -isSDDLSpecifi enablePluginSbFormat, setWSManConfigCommand, PSSessionConfigurationCommandBase.RemoteManagementUsersSID, PSSessionConfigurationCommandBase.InteractiveUsersSID); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_enablePluginSb = ScriptBlock.Create(enablePluginScript); s_enablePluginSb.LanguageMode = PSLanguageMode.FullLanguage; } @@ -4495,7 +4495,7 @@ $_ | Disable-PSSessionConfiguration -force $args[0] -whatif:$args[1] -confirm:$a disablePluginSbFormat); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_disablePluginSb = ScriptBlock.Create(disablePluginScript); s_disablePluginSb.LanguageMode = PSLanguageMode.FullLanguage; } @@ -4902,7 +4902,7 @@ Enable-PSRemoting -force $args[0] -queryForRegisterDefault $args[1] -captionForR RemotingConstants.MaxIdleTimeoutMS, RemotingConstants.PSPluginDLLName); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_enableRemotingSb = ScriptBlock.Create(enableRemotingScript); s_enableRemotingSb.LanguageMode = PSLanguageMode.FullLanguage; } @@ -5126,7 +5126,7 @@ Disable-PSRemoting -force:$args[0] -queryForSet $args[1] -captionForSet $args[2] string disableRemotingScript = string.Format(CultureInfo.InvariantCulture, disablePSRemotingFormat, localSDDL); // compile the script block statically and reuse the same instance - // everytime the command is run..This will save on parsing time. + // every time the command is run..This will save on parsing time. s_disableRemotingSb = ScriptBlock.Create(disableRemotingScript); s_disableRemotingSb.LanguageMode = PSLanguageMode.FullLanguage; } diff --git a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs index f30e4ba510..3e2603a36f 100644 --- a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs +++ b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs @@ -93,7 +93,7 @@ namespace Microsoft.PowerShell.Commands try { - // the following registry key defines WSMan compatability + // the following registry key defines WSMan compatibility // HKLM\Software\Microsoft\Windows\CurrentVersion\WSMAN\ServiceStackVersion string wsManStackValue = null; RegistryKey wsManKey = Registry.LocalMachine.OpenSubKey(WSManKeyPath); diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index ffcb9a8067..600614ca76 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -2983,7 +2983,7 @@ namespace System.Management.Automation.Remoting #endif // These are configuration options for WSMan (WinRM) endpoint configurations, that - // appearand in .pssc files, but are not part of PowerShell InitialSessionState. + // appear in .pssc files, but are not part of PowerShell InitialSessionState. private static readonly HashSet UnsupportedConfigOptions = new HashSet(StringComparer.OrdinalIgnoreCase) { "GroupManagedServiceAccount", diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index ca27ecacca..d5517443a6 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -94,7 +94,7 @@ namespace System.Management.Automation.Language { var effectiveArgType = Adapter.EffectiveArgumentType(obj.Value); var methodInfo = effectiveArgType != typeof(object[]) - ? CachedReflectionInfo.PSInvokeMemberBinder_IsHomogenousArray.MakeGenericMethod(effectiveArgType.GetElementType()) + ? CachedReflectionInfo.PSInvokeMemberBinder_IsHomogeneousArray.MakeGenericMethod(effectiveArgType.GetElementType()) : CachedReflectionInfo.PSInvokeMemberBinder_IsHeterogeneousArray; BindingRestrictions restrictions; @@ -7372,7 +7372,7 @@ namespace System.Management.Automation.Language #region Runtime helpers - internal static bool IsHomogenousArray(object[] args) + internal static bool IsHomogeneousArray(object[] args) { if (args.Length == 0) { diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index 907c07e591..e6efdace4c 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -1478,7 +1478,7 @@ namespace System.Management.Automation do { - // Always assume no need to repeat the search for another interation + // Always assume no need to repeat the search for another iteration continueToSearch = false; // The 'ErrorRecord' of the current RuntimeException would be passed to $_ ErrorRecord errorRecordToPass = rte.ErrorRecord; diff --git a/src/System.Management.Automation/help/AliasHelpProvider.cs b/src/System.Management.Automation/help/AliasHelpProvider.cs index f14f815891..d93aa76b2f 100644 --- a/src/System.Management.Automation/help/AliasHelpProvider.cs +++ b/src/System.Management.Automation/help/AliasHelpProvider.cs @@ -161,7 +161,7 @@ namespace System.Management.Automation foreach (HelpInfo helpInfo in ExactMatchHelp(exactMatchHelpRequest)) { // Component/Role/Functionality match is done only for SearchHelp - // as "get-help * -category alias" should not forwad help to + // as "get-help * -category alias" should not forward help to // CommandHelpProvider..(ExactMatchHelp does forward help to // CommandHelpProvider) if (!Match(helpInfo, helpRequest)) @@ -208,7 +208,7 @@ namespace System.Management.Automation foreach (HelpInfo helpInfo in ExactMatchHelp(exactMatchHelpRequest)) { // Component/Role/Functionality match is done only for SearchHelp - // as "get-help * -category alias" should not forwad help to + // as "get-help * -category alias" should not forward help to // CommandHelpProvider..(ExactMatchHelp does forward help to // CommandHelpProvider) if (!Match(helpInfo, helpRequest)) diff --git a/src/System.Management.Automation/help/ProviderContext.cs b/src/System.Management.Automation/help/ProviderContext.cs index cb24ece059..817e2b3f0e 100644 --- a/src/System.Management.Automation/help/ProviderContext.cs +++ b/src/System.Management.Automation/help/ProviderContext.cs @@ -141,7 +141,7 @@ namespace System.Management.Automation } } - // ok we have path and valid provider that supplys content..initialize the provider + // ok we have path and valid provider that supplies content..initialize the provider // and get the help content for the path. cmdletProvider.Start(providerInfo, cmdletProviderContext); // There should be exactly one resolved path. diff --git a/src/System.Management.Automation/help/UpdatableHelpSystem.cs b/src/System.Management.Automation/help/UpdatableHelpSystem.cs index 31fe5362d7..c909556ade 100644 --- a/src/System.Management.Automation/help/UpdatableHelpSystem.cs +++ b/src/System.Management.Automation/help/UpdatableHelpSystem.cs @@ -1097,14 +1097,14 @@ namespace System.Management.Automation.Help #if UNIX private static bool ExpandArchive(string source, string destination) { - bool sucessfulDecompression = false; + bool successfulDecompression = false; try { using (ZipArchive zipArchive = ZipFile.Open(source, ZipArchiveMode.Read)) { zipArchive.ExtractToDirectory(destination); - sucessfulDecompression = true; + successfulDecompression = true; } } catch (ArgumentException) { } @@ -1116,7 +1116,7 @@ namespace System.Management.Automation.Help catch (UnauthorizedAccessException) { } catch (ObjectDisposedException) { } - return sucessfulDecompression; + return successfulDecompression; } #endif @@ -1137,9 +1137,9 @@ namespace System.Management.Automation.Help } string sourceDirectory = Path.GetDirectoryName(srcPath); - bool sucessfulDecompression = false; + bool successfulDecompression = false; #if UNIX - sucessfulDecompression = ExpandArchive(Path.Combine(sourceDirectory, Path.GetFileName(srcPath)), destPath); + successfulDecompression = ExpandArchive(Path.Combine(sourceDirectory, Path.GetFileName(srcPath)), destPath); #else // Cabinet API doesn't handle the trailing back slash if (!sourceDirectory.EndsWith('\\')) @@ -1152,9 +1152,9 @@ namespace System.Management.Automation.Help destPath += "\\"; } - sucessfulDecompression = CabinetExtractorFactory.GetCabinetExtractor().Extract(Path.GetFileName(srcPath), sourceDirectory, destPath); + successfulDecompression = CabinetExtractorFactory.GetCabinetExtractor().Extract(Path.GetFileName(srcPath), sourceDirectory, destPath); #endif - if (!sucessfulDecompression) + if (!successfulDecompression) { throw new UpdatableHelpSystemException("UnableToExtract", StringUtil.Format(HelpDisplayStrings.UnzipFailure), ErrorCategory.InvalidOperation, null, null); diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index f9af5222a5..5aa81ccd68 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -709,7 +709,7 @@ namespace Microsoft.PowerShell.Commands // We've reached the end of file or end of line. if (_currentLineContent.Length > 0) { - // Add the block read to the ouptut array list, trimming a trailing delimiter, if present. + // Add the block read to the output array list, trimming a trailing delimiter, if present. // Note: If -Tail was specified, we get here in the course of 2 distinct passes: // - Once while reading backward simply to determine the appropriate *start position* for later forward reading, ignoring the content of the blocks read (in reverse). // - Then again during forward reading, for regular output processing; it is only then that trimming the delimiter is necessary. diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 4d7acd99d3..5c2ff6d89c 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -5101,7 +5101,7 @@ namespace Microsoft.PowerShell.Commands #if UNIX // We don't use the Directory.EnumerateFiles() for Unix because the path // may contain additional globbing patterns such as '[ab]' - // which Directory.EnumerateFiles() processes, giving undesireable + // which Directory.EnumerateFiles() processes, giving undesirable // results in this context. if (!File.Exists(result) && !Directory.Exists(result)) { diff --git a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs index c886bbd0a0..31e996e9b6 100644 --- a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs +++ b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs @@ -141,7 +141,7 @@ namespace Microsoft.PowerShell.Commands // the solution is to: // // - First attempt to copy the entire security descriptor as we did in V1. - // This ensures backward compatability for administrator scripts that currently + // This ensures backward compatibility for administrator scripts that currently // work. // - If the attempt fails due to a PrivilegeNotHeld exception, try again with // an estimate of the minimum required subset. This is an estimate, since the diff --git a/src/System.Management.Automation/namespaces/RegistryProvider.cs b/src/System.Management.Automation/namespaces/RegistryProvider.cs index fff328fba2..ecf36bec4c 100644 --- a/src/System.Management.Automation/namespaces/RegistryProvider.cs +++ b/src/System.Management.Automation/namespaces/RegistryProvider.cs @@ -801,7 +801,7 @@ namespace Microsoft.PowerShell.Commands // should not be done. if (textElement.Contains(charactersThatNeedEscaping)) { - // This text element needs espacing + // This text element needs escaping result.Append('`'); } @@ -850,7 +850,7 @@ namespace Microsoft.PowerShell.Commands // should not be done. if (textElement.Contains(charactersThatNeedEscaping)) { - // This text element needs espacing + // This text element needs escaping result.Append('`'); } diff --git a/src/System.Management.Automation/security/CatalogHelper.cs b/src/System.Management.Automation/security/CatalogHelper.cs index 5f71d1f86b..8347423f30 100644 --- a/src/System.Management.Automation/security/CatalogHelper.cs +++ b/src/System.Management.Automation/security/CatalogHelper.cs @@ -689,8 +689,8 @@ namespace System.Management.Automation List relativePathsFromFolder = pathItems.Keys.ToList(); List relativePathsFromCatalog = catalogItems.Keys.ToList(); - // Find entires those are not in both list lists. These should be empty lists for success - // Hashes in Catalog should be exact similar to the ones from folder + // Find entries that are not in both lists. These should be empty lists for success + // Hashes in Catalog should be exactly similar to the ones from folder List relativePathsNotInFolder = relativePathsFromFolder.Except(relativePathsFromCatalog, StringComparer.CurrentCultureIgnoreCase).ToList(); List relativePathsNotInCatalog = relativePathsFromCatalog.Except(relativePathsFromFolder, StringComparer.CurrentCultureIgnoreCase).ToList(); diff --git a/src/System.Management.Automation/security/SecurityManager.cs b/src/System.Management.Automation/security/SecurityManager.cs index 2baf1560a3..e7874ec352 100644 --- a/src/System.Management.Automation/security/SecurityManager.cs +++ b/src/System.Management.Automation/security/SecurityManager.cs @@ -180,7 +180,7 @@ namespace Microsoft.PowerShell } } - // WLDP and Applocker takes priority over powershell exeuction policy. + // WLDP and Applocker takes priority over powershell execution policy. // See if they want to bypass the authorization manager if (_executionPolicy == ExecutionPolicy.Bypass) { diff --git a/src/System.Management.Automation/utils/MetadataExceptions.cs b/src/System.Management.Automation/utils/MetadataExceptions.cs index 53f2328fc3..21e499ce5e 100644 --- a/src/System.Management.Automation/utils/MetadataExceptions.cs +++ b/src/System.Management.Automation/utils/MetadataExceptions.cs @@ -48,7 +48,7 @@ namespace System.Management.Automation /// Initializes a new instance of MetadataException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public MetadataException(string message, Exception innerException) : base(message, innerException) { SetErrorCategory(ErrorCategory.MetadataError); @@ -124,7 +124,7 @@ namespace System.Management.Automation /// Initializes a new instance of ValidationMetadataException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public ValidationMetadataException(string message, Exception innerException) : base(message, innerException) { } internal ValidationMetadataException( @@ -198,7 +198,7 @@ namespace System.Management.Automation /// Initializes a new instance of ArgumentTransformationMetadataException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public ArgumentTransformationMetadataException(string message, Exception innerException) : base(message, innerException) { } @@ -246,7 +246,7 @@ namespace System.Management.Automation /// Initializes a new instance of ParsingMetadataException setting the message and innerException. /// /// The exception's message. - /// The exceptions's inner exception. + /// The exception's inner exception. public ParsingMetadataException(string message, Exception innerException) : base(message, innerException) { } diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs index 9b56da1ae7..586082a0d4 100755 --- a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs @@ -127,7 +127,7 @@ namespace System.Management.Automation.Tracing if (newState == CommandState.Stopped || newState == CommandState.Terminated) { - // When state is stopped or termianted only log the CommandName + // When state is stopped or terminated only log the CommandName payload.AppendLine(StringUtil.Format(EtwLoggingStrings.CommandStateChange, logContext, newState.ToString())); } else diff --git a/src/TypeCatalogGen/TypeCatalogGen.cs b/src/TypeCatalogGen/TypeCatalogGen.cs index aff32f6f82..4bf5605fb0 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.cs +++ b/src/TypeCatalogGen/TypeCatalogGen.cs @@ -97,7 +97,7 @@ Usage: TypeCatalogGen.exe <{0}> <{1}> [{2}] // We only care about public types TypeDefinition typeDefinition = metadataReader.GetTypeDefinition(typeHandle); // The visibility mask is used to mask out the bits that contain the visibility. - // The visibilities are not combineable, e.g. you can't be both public and private, which is why these aren't independent powers of two. + // The visibilities are not combinable, e.g. you can't be both public and private, which is why these aren't independent powers of two. TypeAttributes visibilityBits = typeDefinition.Attributes & TypeAttributes.VisibilityMask; if (visibilityBits != TypeAttributes.Public && visibilityBits != TypeAttributes.NestedPublic) { diff --git a/test/hosting/test_HostingBasic.cs b/test/hosting/test_HostingBasic.cs index e29b14e38c..1b4a67707e 100644 --- a/test/hosting/test_HostingBasic.cs +++ b/test/hosting/test_HostingBasic.cs @@ -183,7 +183,7 @@ namespace PowerShell.Hosting.SDK.Tests Assert.Equal(42, ret); } - /* Test disabled because CommandLineParser is static and can only be intialized once (above in TestConsoleShellScenario) + /* Test disabled because CommandLineParser is static and can only be initialized once (above in TestConsoleShellScenario) /// /// ConsoleShell cannot start with both InitialSessionState and -ConfigurationFile argument configurations specified. /// diff --git a/test/perf/benchmarks/Engine.Compiler.cs b/test/perf/benchmarks/Engine.Compiler.cs index 10e0054a01..4f9dbab88a 100644 --- a/test/perf/benchmarks/Engine.Compiler.cs +++ b/test/perf/benchmarks/Engine.Compiler.cs @@ -58,7 +58,7 @@ namespace Engine // Run it once to get the C# code jitted. // The first call to this takes relatively too long, which makes the BDN's heuristic incorrectly - // believe that there is no need to run many ops in each interation. However, the subsequent runs + // believe that there is no need to run many ops in each iteration. However, the subsequent runs // of this method is much faster than the first run, and this causes 'MinIterationTime' warnings // to our benchmarks and make the benchmark results not reliable. // Calling this method once in 'GlobalSetup' is a workaround. diff --git a/test/perf/benchmarks/Engine.ScriptBlock.cs b/test/perf/benchmarks/Engine.ScriptBlock.cs index 1f9ac98942..dfd7beb865 100644 --- a/test/perf/benchmarks/Engine.ScriptBlock.cs +++ b/test/perf/benchmarks/Engine.ScriptBlock.cs @@ -51,7 +51,7 @@ namespace Engine // Run it once to get the C# code jitted and the script compiled. // The first call to this takes relatively too long, which makes the BDN's heuristic incorrectly - // believe that there is no need to run many ops in each interation. However, the subsequent runs + // believe that there is no need to run many ops in each iteration. However, the subsequent runs // of this method is much faster than the first run, and this causes 'MinIterationTime' warnings // to our benchmarks and make the benchmark results not reliable. // Calling this method once in 'GlobalSetup' is a workaround. diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/PerfLabExporter.cs b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/PerfLabExporter.cs index b50e408af0..86306da342 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/PerfLabExporter.cs +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/PerfLabExporter.cs @@ -25,7 +25,7 @@ namespace BenchmarkDotNet.Extensions var reporter = Reporter.CreateReporter(); DisassemblyDiagnoser disassemblyDiagnoser = summary.Reports - .FirstOrDefault()? // dissasembler was either enabled for all or none of them (so we use the first one) + .FirstOrDefault()? // disassembler was either enabled for all or none of them (so we use the first one) .BenchmarkCase.Config.GetDiagnosers().OfType().FirstOrDefault(); foreach (var report in summary.Reports) diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/RecommendedConfig.cs b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/RecommendedConfig.cs index 40aa5f87fb..a8aac9700b 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/RecommendedConfig.cs +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/RecommendedConfig.cs @@ -31,7 +31,7 @@ namespace BenchmarkDotNet.Extensions { job = Job.Default .WithWarmupCount(1) // 1 warmup is enough for our purpose - .WithIterationTime(TimeInterval.FromMilliseconds(250)) // the default is 0.5s per iteration, which is slighlty too much for us + .WithIterationTime(TimeInterval.FromMilliseconds(250)) // the default is 0.5s per iteration, which is slightly too much for us .WithMinIterationCount(15) .WithMaxIterationCount(20) // we don't want to run more that 20 iterations .DontEnforcePowerPlan(); // make sure BDN does not try to enforce High Performance power plan on Windows diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/TooManyTestCasesValidator.cs b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/TooManyTestCasesValidator.cs index 36c8b41f9c..b001f603dc 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/TooManyTestCasesValidator.cs +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/TooManyTestCasesValidator.cs @@ -26,7 +26,7 @@ namespace BenchmarkDotNet.Extensions return byDescriptor.Where(benchmarkCase => benchmarkCase.Count() > Limit).Select(group => new ValidationError( isCritical: true, - message: $"{group.Key.Descriptor.Type.Name}.{group.Key.Descriptor.WorkloadMethod.Name} has {group.Count()} test cases. It MUST NOT have more than {Limit} test cases. We don't have inifinite amount of time to run all the benchmarks!!", + message: $"{group.Key.Descriptor.Type.Name}.{group.Key.Descriptor.WorkloadMethod.Name} has {group.Count()} test cases. It MUST NOT have more than {Limit} test cases. We don't have infinite amount of time to run all the benchmarks!!", benchmarkCase: group.First())); } }