Fix typos in comments (#19064)

This commit is contained in:
spaette
2023-02-03 10:40:43 +05:00
committed by GitHub
parent 7fe5cb3e35
commit ec0eb22062
63 changed files with 108 additions and 108 deletions
+1 -1
View File
@@ -222,7 +222,7 @@
<RegistryValue Type="string" Name="InstallDir" Value="[VersionFolder]" KeyPath="yes"/>
</RegistryKey>
</Component>
<!-- Explorer context menu with 2 submenus to open PowerShell normally or as an Administator.
<!-- Explorer context menu with 2 submenus to open PowerShell normally or as an Administrator.
See https://blogs.msdn.microsoft.com/andrew_richards/2017/03/01/enhancing-the-open-command-prompt-here-shift-right-click-context-menu-experience/ for details -->
<Component Id="ExplorerContextMenu">
<Condition>ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL</Condition>
@@ -12,8 +12,8 @@ namespace Microsoft.Management.UI.Internal
{
/// <summary>
/// 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).
/// </summary>
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;
}
@@ -43,8 +43,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;
@@ -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
/// <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);
@@ -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);
@@ -1190,7 +1190,7 @@ namespace Microsoft.PowerShell.Commands
/// </param>
/// <returns>
/// A Nullable<typeparamref name="T"/> 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.
/// </returns>
@@ -1565,7 +1565,7 @@ namespace Microsoft.PowerShell.Commands
/// <param name="request">The WebRequest who's content is to be set.</param>
/// <param name="content">A byte array containing the content data.</param>
/// <remarks>
/// 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.
/// </remarks>
internal void SetRequestContent(HttpRequestMessage request, byte[] content)
@@ -1583,7 +1583,7 @@ namespace Microsoft.PowerShell.Commands
/// <param name="request">The WebRequest who's content is to be set.</param>
/// <param name="content">A String object containing the content data.</param>
/// <remarks>
/// 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.
/// </remarks>
internal void SetRequestContent(HttpRequestMessage request, string content)
@@ -1650,7 +1650,7 @@ namespace Microsoft.PowerShell.Commands
/// <param name="request">The WebRequest who's content is to be set.</param>
/// <param name="contentStream">A Stream object containing the content data.</param>
/// <remarks>
/// 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.
/// </remarks>
internal void SetRequestContent(HttpRequestMessage request, Stream contentStream)
@@ -1668,7 +1668,7 @@ namespace Microsoft.PowerShell.Commands
/// <param name="request">The WebRequest who's content is to be set.</param>
/// <param name="multipartContent">A MultipartFormDataContent object containing multipart/form-data content.</param>
/// <remarks>
/// 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.
/// </remarks>
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);
}
}
@@ -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);
@@ -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);
@@ -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);
@@ -191,7 +191,7 @@ Do you want to enable CredSSP authentication?</value>
<data name="NoAttributeMatch" xml:space="preserve">
<value>This command cannot be used because the parameter matches a non-text property on the ResourceURI.Check the input parameters and run your command.</value>
</data>
<data name="AmbiguosAuthentication" xml:space="preserve">
<data name="AmbiguousAuthentication" xml:space="preserve">
<value>A {0} cannot be specified when {1} is specified.</value>
</data>
<data name="InvalidComputerName" xml:space="preserve">
@@ -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.
@@ -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);
@@ -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)
@@ -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)
@@ -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.
//
@@ -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);
@@ -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.
///
@@ -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;
}
@@ -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;
}
@@ -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)
{
@@ -36,7 +36,7 @@ namespace System.Management.Automation
/// Initializes a new instance of ExtendedTypeSystemException setting the message and innerException.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
public PSInvalidCastException(string message, Exception innerException)
: base(message, innerException)
{
@@ -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.
@@ -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),
@@ -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"
@@ -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);
@@ -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 (<Program Files> location) and by 'user-specific location' (SpecialFolder.MyDocuments or EVT.User))
@@ -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;
@@ -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;
}
}
@@ -1447,7 +1447,7 @@ namespace System.Management.Automation
/// could not be created.
/// </exception>
[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,
@@ -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;
@@ -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);
}
@@ -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();
}
@@ -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
@@ -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.
@@ -1512,7 +1512,7 @@ namespace System.Management.Automation.Runspaces
/// Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message and innerException.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
public RunspaceOpenModuleLoadException(string message, Exception innerException)
: base(message, innerException)
{
@@ -1359,7 +1359,7 @@ namespace System.Management.Automation
/// Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message and innerException.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
public ScriptBlockToPowerShellNotSupportedException(string message, Exception innerException)
: base(message, innerException)
{
@@ -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);
@@ -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;
@@ -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;
}
@@ -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;
@@ -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;
}
@@ -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);
@@ -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<string> UnsupportedConfigOptions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"GroupManagedServiceAccount",
@@ -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<T>(object[] args)
internal static bool IsHomogeneousArray<T>(object[] args)
{
if (args.Length == 0)
{
@@ -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;
@@ -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))
@@ -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.
@@ -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);
@@ -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.
@@ -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))
{
@@ -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
@@ -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('`');
}
@@ -689,8 +689,8 @@ namespace System.Management.Automation
List<string> relativePathsFromFolder = pathItems.Keys.ToList();
List<string> 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<string> relativePathsNotInFolder = relativePathsFromFolder.Except(relativePathsFromCatalog, StringComparer.CurrentCultureIgnoreCase).ToList();
List<string> relativePathsNotInCatalog = relativePathsFromCatalog.Except(relativePathsFromFolder, StringComparer.CurrentCultureIgnoreCase).ToList();
@@ -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)
{
@@ -48,7 +48,7 @@ namespace System.Management.Automation
/// Initializes a new instance of MetadataException setting the message and innerException.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
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.
/// </summary>
/// <param name="message">The exception's message.</param>
/// <param name="innerException">The exceptions's inner exception.</param>
/// <param name="innerException">The exception's inner exception.</param>
public ParsingMetadataException(string message, Exception innerException)
: base(message, innerException) { }
@@ -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
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
/// <summary>
/// ConsoleShell cannot start with both InitialSessionState and -ConfigurationFile argument configurations specified.
/// </summary>
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
@@ -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<DisassemblyDiagnoser>().FirstOrDefault();
foreach (var report in summary.Reports)
@@ -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
@@ -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()));
}
}