ScriptSyntax DetermineSyntax(VariableDictionary variables) { var scriptFileName = variables.Get(SpecialVariables.Action.Script.ScriptFileName); if (WasProvided(scriptFileName) && Enum.TryParse(Path.GetExtension(scriptFileName), out ScriptSyntax fileNameSyntax)) { return(fileNameSyntax); } if (WasProvided(scriptFileArg) && Enum.TryParse(Path.GetExtension(scriptFileArg), out ScriptSyntax fileArgSyntax)) { return(fileArgSyntax); } return(variables.GetEnum(SpecialVariables.Action.Script.Syntax, ScriptSyntax.PowerShell)); }