@@ -23,13 +23,23 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
2323 /// The rule implements a correction that suggests using type-casting or type constructor.
2424 ///
2525 /// Note:
26- /// In case a automatic correction isn't available, the rule won't report any violation either.
27- /// This is because if there isn't an automatic correction available, it means that the there
28- /// isn't a simple type-casting or type constructor that can be used as a replacement that
29- /// would be more efficient or has a better syntax than using New-Object.
30- /// In other words, if the `-ComObject` parameter is used, or both the parameters
26+ /// In most cases if there isn't an automatic correction isn't available,
27+ /// the rule won't report any violation either.
28+ /// This is because if there isn't an automatic correction available, it generally means
29+ /// that there isn't a simple type-casting or type constructor that can be used that would
30+ /// be more efficient or has a better syntax than using New-Object.
31+ /// In other words, if the common `-Verbose` parameter is used, or both the parameters
3132 /// `-ArgumentList` and `-Property` are used, there won't be a simple type initializer
3233 /// available and the rule won't report any violation for the `New-Object` cmdlet.
34+ ///
35+ /// Nevertheless, there are still some cases where the `New-Object` cmdlet might be
36+ /// replaceable with a type initializer that would be more efficient or has a better syntax,
37+ /// but an automatic correction can't be provided.
38+ /// For example if the `-ArgumentList` parameter is used with a variable,
39+ /// the rule will report a violation, but won't be able to provide a correction,
40+ /// as it's not possible to determine from the AST alone whether the variable contains a
41+ /// single value that can be used in a type initializer,
42+ /// or if it contains multiple values that would require splatting.
3343 /// </summary>
3444 public class AvoidUsingNewObject : ConfigurableRule
3545 {
0 commit comments