diff --git a/Rules/PossibleIncorrectComparisonWithNull.cs b/Rules/PossibleIncorrectComparisonWithNull.cs index 3302583ae..692f49f13 100644 --- a/Rules/PossibleIncorrectComparisonWithNull.cs +++ b/Rules/PossibleIncorrectComparisonWithNull.cs @@ -104,7 +104,7 @@ private IEnumerable GetCorrectionExtent(BinaryExpressionAst bi binaryExpressionAst.Extent.EndColumnNumber, $"{binaryExpressionAst.Right.Extent.Text} {binaryExpressionAst.ErrorPosition.Text} {binaryExpressionAst.Left.Extent.Text}", binaryExpressionAst.Extent.File, - Strings.PossibleIncorrectComparisonWithNullSuggesteCorrectionDescription + Strings.PossibleIncorrectComparisonWithNullSuggestedCorrectionDescription ); yield return correction; diff --git a/Rules/Strings.resx b/Rules/Strings.resx index c7645c9cf..6826f965d 100644 --- a/Rules/Strings.resx +++ b/Rules/Strings.resx @@ -124,7 +124,7 @@ Avoid Using Cmdlet Aliases or omitting the 'Get-' prefix. - Empty catch blocks are considered poor design decisions because if an error occurs in the try block, this error is simply swallowed and not acted upon. While this does not inherently lead to bad things. It can and this should be avoided if possible. To fix a violation of this rule, using Write-Error or throw statements in catch blocks. + Empty catch blocks are considered poor design decisions because if an error occurs in the try block, this error is simply swallowed and not acted upon. While this does not inherently cause problems, it can, so it should be avoided where possible. To fix a violation of this rule, use Write-Error or throw statements in catch blocks. Avoid Using Empty Catch Block @@ -136,7 +136,7 @@ Avoid Using Invoke-Expression - Readability and clarity should be the goal of any script we expect to maintain over time. When calling a command that takes parameters, where possible consider using name parameters as opposed to positional parameters. To fix a violation of this rule, please use named parameters instead of positional parameters when calling a command. + Readability and clarity should be the goal of any script we expect to maintain over time. When calling a command that takes parameters, where possible consider using named parameters as opposed to positional parameters. To fix a violation of this rule, please use named parameters instead of positional parameters when calling a command. Avoid Using Positional Parameters @@ -178,7 +178,7 @@ No Global Variables - Checks that $null is on the left side of any equaltiy comparisons (eq, ne, ceq, cne, ieq, ine). When there is an array on the left side of a null equality comparison, PowerShell will check for a $null IN the array rather than if the array is null. If the two sides of the comaprision are switched this is fixed. Therefore, $null should always be on the left side of equality comparisons just in case. + Checks that $null is on the left side of any equality comparisons (eq, ne, ceq, cne, ieq, ine). When there is an array on the left side of a null equality comparison, PowerShell will check for a $null IN the array rather than if the array is null. If the two sides of the comparison are switched this is fixed. Therefore, $null should always be on the left side of equality comparisons just in case. $null should be on the left side of equality comparisons. @@ -618,7 +618,7 @@ Use ShouldProcess For State Changing Functions - + Functions that have verbs like New, Start, Stop, Set, Reset, Restart that change system state should support 'ShouldProcess'. @@ -703,7 +703,7 @@ PowerShell help file needs to use UTF8 Encoding. - File {0} has to use UTF8 instead of {1} encoding because it is a powershell help file. + File {0} has to use UTF8 instead of {1} encoding because it is a PowerShell help file. UseUTF8EncodingForHelpFile @@ -742,7 +742,7 @@ Misleading Backtick - Ending a line with an escaped whitepsace character is misleading. A trailing backtick is usually used for line continuation. Users typically don't intend to end a line with escaped whitespace. + Ending a line with an escaped whitespace character is misleading. A trailing backtick is usually used for line continuation. Users typically don't intend to end a line with escaped whitespace. MisleadingBacktick @@ -786,16 +786,16 @@ Replace {0} with {1} - + Create hashtables with literal initializers - + Use literal initializer, @{{}}, for creating a hashtable as they are case-insensitive by default - - Create hashtables with literal initliazers + + Create hashtables with literal initializers - + UseLiteralInitializerForHashtable @@ -874,7 +874,7 @@ The type accelerator '{0}' is not available by default in PowerShell version '{1}' on platform '{2}' - Avoid global functiosn and aliases + Avoid global functions and aliases Checks that global functions and aliases are not used. Global functions are strongly discouraged as they can cause errors across different systems. @@ -979,7 +979,7 @@ Use consistent indentation - Each statement block should have a consistent indenation. + Each statement block should have a consistent indentation. Indentation not consistent @@ -991,7 +991,7 @@ Use whitespaces - Check for whitespace between keyword and open paren/curly, around assigment operator ('='), around arithmetic operators and after separators (',' and ';') + Check for whitespace between keyword and open paren/curly, around assignment operator ('='), around arithmetic operators and after separators (',' and ';') Use space before open brace. @@ -1015,10 +1015,10 @@ Use SupportsShouldProcess - Commands typically provide Confirm and Whatif parameters to give more control on its execution in an interactive environment. In PowerShell, a command can use a SupportsShouldProcess attribute to provide this capability. Hence, manual addition of these parameters to a command is discouraged. If a commands need Confirm and Whatif parameters, then it should support ShouldProcess. + Commands typically provide Confirm and WhatIf parameters to give more control on its execution in an interactive environment. In PowerShell, a command can use a SupportsShouldProcess attribute to provide this capability. Hence, manual addition of these parameters to a command is discouraged. If a command needs Confirm and WhatIf parameters, then it should support ShouldProcess. - Whatif and/or Confirm manually defined in function {0}. Instead, please use SupportsShouldProcess attribute. + WhatIf and/or Confirm manually defined in function {0}. Instead, please use SupportsShouldProcess attribute. AlignAssignmentStatement @@ -1042,10 +1042,10 @@ Use a different variable name - Changing automtic variables might have undesired side effects + Changing automatic variables might have undesired side effects - This automatic variables is built into PowerShell and readonly. + This automatic variable is built into PowerShell and readonly. The Variable '{0}' cannot be assigned since it is a readonly automatic variable that is built into PowerShell, please use a different name. @@ -1077,7 +1077,7 @@ PossibleIncorrectUsageOfRedirectionOperator - + Use $null on the left hand side for safe comparison with $null. @@ -1177,7 +1177,7 @@ Avoid multiple type specifiers on parameters - Prameter should not have more than one type specifier. + Parameter should not have more than one type specifier. Parameter '{0}' has more than one type specifier. @@ -1219,7 +1219,7 @@ Avoid sending credentials and secrets over unencrypted connections. - The insecure AllowUsingUnencryptedAuthentication switch was used. This should be avoided except for compatability with legacy systems. + The insecure AllowUnencryptedAuthentication switch was used. This should be avoided except for compatibility with legacy systems. AvoidUsingAllowUnencryptedAuthentication diff --git a/Rules/UseLiteralInitializerForHashtable.cs b/Rules/UseLiteralInitializerForHashtable.cs index 8f59d8332..56a31508f 100644 --- a/Rules/UseLiteralInitializerForHashtable.cs +++ b/Rules/UseLiteralInitializerForHashtable.cs @@ -62,7 +62,7 @@ public IEnumerable AnalyzeScript(Ast ast, string fileName) /// public string GetCommonName() { - return string.Format(CultureInfo.CurrentCulture, Strings.UseLiteralInitilializerForHashtableCommonName); + return string.Format(CultureInfo.CurrentCulture, Strings.UseLiteralInitializerForHashtableCommonName); } /// @@ -70,7 +70,7 @@ public string GetCommonName() /// public string GetDescription() { - return string.Format(CultureInfo.CurrentCulture, Strings.UseLiteralInitilializerForHashtableDescription); + return string.Format(CultureInfo.CurrentCulture, Strings.UseLiteralInitializerForHashtableDescription); } /// @@ -82,7 +82,7 @@ public string GetName() CultureInfo.CurrentCulture, Strings.NameSpaceFormat, GetSourceName(), - Strings.UseLiteralInitilializerForHashtableName); + Strings.UseLiteralInitializerForHashtableName); } /// @@ -170,7 +170,7 @@ public override AstVisitAction VisitInvokeMemberExpression(InvokeMemberExpressio || !HasIgnoreCaseComparerArg(methodCallAst.Arguments)) { var dr = new DiagnosticRecord( - Strings.UseLiteralInitilializerForHashtableDescription, + Strings.UseLiteralInitializerForHashtableDescription, methodCallAst.Extent, GetName(), GetDiagnosticSeverity(), @@ -205,7 +205,7 @@ private void AnalyzeNewObjectCommand(CommandAst commandAst) } var dr = new DiagnosticRecord( - Strings.UseLiteralInitilializerForHashtableDescription, + Strings.UseLiteralInitializerForHashtableDescription, commandAst.Extent, GetName(), GetDiagnosticSeverity(), diff --git a/Rules/UseShouldProcessForStateChangingFunctions.cs b/Rules/UseShouldProcessForStateChangingFunctions.cs index 4448e6693..0d526042f 100644 --- a/Rules/UseShouldProcessForStateChangingFunctions.cs +++ b/Rules/UseShouldProcessForStateChangingFunctions.cs @@ -102,7 +102,7 @@ public string GetCommonName() /// The description of this rule public string GetDescription() { - return string.Format(CultureInfo.CurrentCulture, Strings.UseShouldProcessForStateChangingFunctionsDescrption); + return string.Format(CultureInfo.CurrentCulture, Strings.UseShouldProcessForStateChangingFunctionsDescription); } ///