diff --git a/Rules/CompatibilityRules/UseCompatibleSyntax.cs b/Rules/CompatibilityRules/UseCompatibleSyntax.cs index 22f44b86f..fc063f3ff 100644 --- a/Rules/CompatibilityRules/UseCompatibleSyntax.cs +++ b/Rules/CompatibilityRules/UseCompatibleSyntax.cs @@ -29,12 +29,15 @@ public class UseCompatibleSyntax : ConfigurableRule private static readonly Version s_v6 = new Version(6,0); + private static readonly Version s_v7 = new Version(7,0); + private static readonly IReadOnlyList s_targetableVersions = new [] { s_v3, s_v4, s_v5, - s_v6 + s_v6, + s_v7, }; /// @@ -123,7 +126,7 @@ private static HashSet GetTargetedVersions(string[] versionSettings) { if (versionSettings == null || versionSettings.Length <= 0) { - return new HashSet(){ s_v5, s_v6 }; + return new HashSet(){ s_v5, s_v6, s_v7 }; } var targetVersions = new HashSet(); @@ -278,7 +281,7 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun { // Look for PowerShell workflows in the script - if (!_targetVersions.Contains(s_v6)) + if (!(_targetVersions.Contains(s_v6) || _targetVersions.Contains(s_v7))) { return AstVisitAction.Continue; }