From f121ff6fdfc6ca009cd8a5ed1ce7d79b56f8c31c Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 17 Sep 2018 09:28:33 -0400 Subject: [PATCH 1/5] adding logic for powershell-script-rule --- .../Cognifide.PowerShell.csproj | 1 + .../Core/Rules/PowerShellBooleanScriptRule.cs | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Cognifide.PowerShell/Core/Rules/PowerShellBooleanScriptRule.cs diff --git a/Cognifide.PowerShell/Cognifide.PowerShell.csproj b/Cognifide.PowerShell/Cognifide.PowerShell.csproj index 18d4956c2..fede33593 100644 --- a/Cognifide.PowerShell/Cognifide.PowerShell.csproj +++ b/Cognifide.PowerShell/Cognifide.PowerShell.csproj @@ -512,6 +512,7 @@ + diff --git a/Cognifide.PowerShell/Core/Rules/PowerShellBooleanScriptRule.cs b/Cognifide.PowerShell/Core/Rules/PowerShellBooleanScriptRule.cs new file mode 100644 index 000000000..aae88dc82 --- /dev/null +++ b/Cognifide.PowerShell/Core/Rules/PowerShellBooleanScriptRule.cs @@ -0,0 +1,54 @@ +using System; +using System.Linq; +using Cognifide.PowerShell.Core.Extensions; +using Cognifide.PowerShell.Core.Host; +using Sitecore.Data; +using Sitecore.Diagnostics; +using Sitecore.Rules; +using Sitecore.Rules.Conditions; + +namespace Cognifide.PowerShell.Core.Rules +{ + public class PowerShellBooleanScriptRule : StringOperatorCondition where T : RuleContext + { + public ID ScriptId { get; set; } + protected override bool Execute(T ruleContext) + { + var ruleResponse = false; + Assert.IsNotNull(ruleContext, "RuleContext is null"); + try + { + var scriptItem = Sitecore.Context.Database.GetItem(ScriptId); + if (scriptItem.InheritsFrom(Templates.Script.Id)) + { + var scriptItemField = scriptItem.Fields[Templates.Script.Fields.ScriptBody]; + using (ScriptSession scriptSession = ScriptSessionManager.NewSession("Default", true)) + { + string script = scriptItemField.GetValue(false); + if (!string.IsNullOrEmpty(script)) + { + var results = scriptSession.ExecuteScriptPart(script, false); + //if anything in results is a non-false value, return true + ruleResponse = results.Any(r => bool.Parse(r.ToString())); + } + else + { + Log.Warn("Selected Script Item is empty", this); + } + } + } + else + { + Log.Warn("Selected Item is not a Script", this); + } + + } + catch (Exception ex) + { + Log.Error("Error in Boolean Script Rule", ex, this); + throw; + } + return ruleResponse; + } + } +} \ No newline at end of file From 2fd4711639f86975fc560f889a7397cd881e6495 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 20 Oct 2018 12:17:22 -0400 Subject: [PATCH 2/5] finally created rule in sitecore --- .../Core/Rules/PowerShellMacro.cs | 76 +++++++++++++++++++ .../Script Returns Non-Null Value.yml | 25 ++++++ 2 files changed, 101 insertions(+) create mode 100644 Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml diff --git a/Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs b/Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs new file mode 100644 index 000000000..543dad33d --- /dev/null +++ b/Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs @@ -0,0 +1,76 @@ +using System; +using System.Globalization; +using System.Web; +using System.Xml.Linq; +using Cognifide.PowerShell.Core.Extensions; +using Cognifide.PowerShell.Core.Host; +using Sitecore; +using Sitecore.Diagnostics; +using Sitecore.Rules.RuleMacros; +using Sitecore.Text; +using Sitecore.Web.UI.Pages; +using Sitecore.Web.UI.Sheer; +using Sitecore.Web.UI.WebControls; + +namespace Cognifide.PowerShell.Core.Rules +{ + public class PowerShellMacro: DialogForm, IRuleMacro + { + + public void Execute(XElement element, string name, UrlString parameters, string value) + { + Assert.ArgumentNotNull(element, "element"); + Assert.ArgumentNotNull(name, "name"); + Assert.ArgumentNotNull(parameters, "parameters"); + Assert.ArgumentNotNull(value, "value"); + string scriptId = parameters["script"]; + try + { + var scriptItem = Sitecore.Client.ContentDatabase.GetItem(scriptId); + var itemStr = XElement.Parse(element.ToString()).FirstAttribute.Value; + var currentItem = Sitecore.Client.ContentDatabase.GetItem(itemStr); + if (scriptItem.InheritsFrom(Templates.Script.Id)) + { + var scriptItemField = scriptItem.Fields[Templates.Script.Fields.ScriptBody]; + + string script = scriptItemField.GetValue(false); + if (!string.IsNullOrEmpty(script)) + { + //todo verify that readVariables opens a prompt + var str = new UrlString(UIUtil.GetUri("control:PowerShellRunner")); + var scriptResultKey = Guid.NewGuid().ToString(); + if (currentItem != null) + { + str.Append("id", currentItem.ID.ToString()); + str.Append("db", currentItem.Database.Name); + str.Append("ver", currentItem.Version.Number.ToString(CultureInfo.InvariantCulture)); + str.Append("lang", currentItem.Language.Name); + } + str.Append("scriptId", scriptItem.ID.ToString()); + str.Append("scriptDb", scriptItem.Database.Name); + str.Append("sessionKey", scriptResultKey); + var clientPageClientResponse = Context.ClientPage.ClientResponse; + clientPageClientResponse.EnableOutput(); + clientPageClientResponse.ShowModalDialog(str.ToString(), "400", "260", "PowerShell Script Results", true); + string scriptResult = HttpContext.Current.Session[scriptResultKey].ToString(); + clientPageClientResponse.SetReturnValue(scriptResult); + } + else + { + Log.Warn("Selected Script Item is empty", this); + } + } + else + { + Log.Warn("Selected Item is not a Script", this); + } + + } + catch (Exception ex) + { + Log.Error("Error in Boolean Script Rule", ex, this); + throw; + } + } + } +} \ No newline at end of file diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml new file mode 100644 index 000000000..3dbb18487 --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml @@ -0,0 +1,25 @@ +--- +ID: "7477d094-b434-4ceb-bccc-45c02ceb6a5d" +Parent: "c84f4255-cf8a-455d-9c11-94a774773aba" +Template: "f0d16eee-3a05-4e43-a082-795a32b873c0" +Path: "/sitecore/system/Settings/Rules/Definitions/Elements/PowerShell/Script Returns Non-Null Value" +DB: master +SharedFields: +- ID: "ab51c8b2-f0e1-4471-9aae-cc080d774923" + Hint: Type + Value: Cognifide.PowerShell.Core.Rules.PowerShellBooleanScriptRule,Cognifide.PowerShell +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20181020T152609Z + - ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f" + Hint: __Created by + Value: | + sitecore\admin + - ID: "af321234-4eb9-4ef5-9197-65903351939c" + Hint: Text + Value: "where [ScriptId,TreeList,root=/sitecore/system/Modules/PowerShell/Script Library,specific script] returns a non-null value" From ca171c17567d90e8b1695b590d6edfc315267413 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 22 Oct 2018 09:26:24 -0400 Subject: [PATCH 3/5] rename rule to something more accurate --- .../Cognifide.PowerShell.Serialization.config | 2 + .../Core/Rules/PowerShellMacro.cs | 76 ------------------- .../PowerShell Editor Rules.yml | 22 ++++++ .../PowerShell Editor Rules/Visibility.yml | 18 +++++ .../Editor Rules/PowerShell Editor Rules.yml | 19 +++++ .../Script Returns True Value.yml} | 7 +- .../PowerShell Editor Rules/Tags.yml | 19 +++++ .../PowerShell Editor Rules/Tags/Default.yml | 23 ++++++ .../PowerShell Editor Rules/Visibility.yml | 19 +++++ 9 files changed, 126 insertions(+), 79 deletions(-) delete mode 100644 Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules.yml create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules/Visibility.yml create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules.yml rename Cognifide.PowerShell/Data/Serialization/Rules/{Rules/PowerShell/Script Returns Non-Null Value.yml => Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml} (67%) create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags.yml create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags/Default.yml create mode 100644 Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Visibility.yml diff --git a/Cognifide.PowerShell/App_Config/Include/Cognifide.PowerShell.Serialization.config b/Cognifide.PowerShell/App_Config/Include/Cognifide.PowerShell.Serialization.config index 8405ca030..a0bfa4f29 100644 --- a/Cognifide.PowerShell/App_Config/Include/Cognifide.PowerShell.Serialization.config +++ b/Cognifide.PowerShell/App_Config/Include/Cognifide.PowerShell.Serialization.config @@ -8,9 +8,11 @@ + + diff --git a/Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs b/Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs deleted file mode 100644 index 543dad33d..000000000 --- a/Cognifide.PowerShell/Core/Rules/PowerShellMacro.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Globalization; -using System.Web; -using System.Xml.Linq; -using Cognifide.PowerShell.Core.Extensions; -using Cognifide.PowerShell.Core.Host; -using Sitecore; -using Sitecore.Diagnostics; -using Sitecore.Rules.RuleMacros; -using Sitecore.Text; -using Sitecore.Web.UI.Pages; -using Sitecore.Web.UI.Sheer; -using Sitecore.Web.UI.WebControls; - -namespace Cognifide.PowerShell.Core.Rules -{ - public class PowerShellMacro: DialogForm, IRuleMacro - { - - public void Execute(XElement element, string name, UrlString parameters, string value) - { - Assert.ArgumentNotNull(element, "element"); - Assert.ArgumentNotNull(name, "name"); - Assert.ArgumentNotNull(parameters, "parameters"); - Assert.ArgumentNotNull(value, "value"); - string scriptId = parameters["script"]; - try - { - var scriptItem = Sitecore.Client.ContentDatabase.GetItem(scriptId); - var itemStr = XElement.Parse(element.ToString()).FirstAttribute.Value; - var currentItem = Sitecore.Client.ContentDatabase.GetItem(itemStr); - if (scriptItem.InheritsFrom(Templates.Script.Id)) - { - var scriptItemField = scriptItem.Fields[Templates.Script.Fields.ScriptBody]; - - string script = scriptItemField.GetValue(false); - if (!string.IsNullOrEmpty(script)) - { - //todo verify that readVariables opens a prompt - var str = new UrlString(UIUtil.GetUri("control:PowerShellRunner")); - var scriptResultKey = Guid.NewGuid().ToString(); - if (currentItem != null) - { - str.Append("id", currentItem.ID.ToString()); - str.Append("db", currentItem.Database.Name); - str.Append("ver", currentItem.Version.Number.ToString(CultureInfo.InvariantCulture)); - str.Append("lang", currentItem.Language.Name); - } - str.Append("scriptId", scriptItem.ID.ToString()); - str.Append("scriptDb", scriptItem.Database.Name); - str.Append("sessionKey", scriptResultKey); - var clientPageClientResponse = Context.ClientPage.ClientResponse; - clientPageClientResponse.EnableOutput(); - clientPageClientResponse.ShowModalDialog(str.ToString(), "400", "260", "PowerShell Script Results", true); - string scriptResult = HttpContext.Current.Session[scriptResultKey].ToString(); - clientPageClientResponse.SetReturnValue(scriptResult); - } - else - { - Log.Warn("Selected Script Item is empty", this); - } - } - else - { - Log.Warn("Selected Item is not a Script", this); - } - - } - catch (Exception ex) - { - Log.Error("Error in Boolean Script Rule", ex, this); - throw; - } - } - } -} \ No newline at end of file diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules.yml new file mode 100644 index 000000000..964cd9239 --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules.yml @@ -0,0 +1,22 @@ +--- +ID: "f9ce8201-c7fd-4217-ac4a-45205ca80faf" +Parent: "dadb4f93-477f-491f-a905-c4005c452e67" +Template: "1a9b6300-4652-477c-a4b5-b2a64e86b29f" +Path: /sitecore/system/Settings/Rules/Definitions/Tags/PowerShell Editor Rules +DB: master +SharedFields: +- ID: "ba3f86a2-4a1c-4d78-b63d-91c2779c1b5e" + Hint: __Sortorder + Value: 2400 +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20131231T141935 + - ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f" + Hint: __Created by + Value: | + sitecore\admin diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules/Visibility.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules/Visibility.yml new file mode 100644 index 000000000..6b10b7861 --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules Tags/PowerShell Editor Rules/Visibility.yml @@ -0,0 +1,18 @@ +--- +ID: "ebb33f36-07c6-4268-9382-fe432e70f1ad" +Parent: "f9ce8201-c7fd-4217-ac4a-45205ca80faf" +Template: "aa91a868-02f2-41d3-8b78-1cad91b4dcae" +Path: /sitecore/system/Settings/Rules/Definitions/Tags/PowerShell Editor Rules/Visibility +DB: master +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20131231T141936 + - ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f" + Hint: __Created by + Value: | + sitecore\admin diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules.yml new file mode 100644 index 000000000..b8730fd89 --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules.yml @@ -0,0 +1,19 @@ +--- +ID: "d555657d-f954-497c-a293-65d5e695ab61" +Parent: "e7cbefe8-9112-4b95-a978-4e470d94c54a" +Template: "54dae7cd-bfd8-4e69-9679-75f2ae9f9034" +Path: /sitecore/system/Settings/Rules/Definitions/Elements/PowerShell Editor Rules +DB: master +BranchID: "9a72c539-dbf8-4dad-96d3-a298fc04add6" +SharedFields: +- ID: "f6d8a61c-2f84-4401-bd24-52d2068172bc" + Hint: __Originator + Value: "{8D1DB71C-9ACF-4192-8384-5F9B6D533F95}" +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20181020T161858Z diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml similarity index 67% rename from Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml rename to Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml index 3dbb18487..53e1ca42b 100644 --- a/Cognifide.PowerShell/Data/Serialization/Rules/Rules/PowerShell/Script Returns Non-Null Value.yml +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml @@ -1,8 +1,8 @@ --- ID: "7477d094-b434-4ceb-bccc-45c02ceb6a5d" -Parent: "c84f4255-cf8a-455d-9c11-94a774773aba" +Parent: "d555657d-f954-497c-a293-65d5e695ab61" Template: "f0d16eee-3a05-4e43-a082-795a32b873c0" -Path: "/sitecore/system/Settings/Rules/Definitions/Elements/PowerShell/Script Returns Non-Null Value" +Path: /sitecore/system/Settings/Rules/Definitions/Elements/PowerShell Editor Rules/Script Returns True Value DB: master SharedFields: - ID: "ab51c8b2-f0e1-4471-9aae-cc080d774923" @@ -22,4 +22,5 @@ Languages: sitecore\admin - ID: "af321234-4eb9-4ef5-9197-65903351939c" Hint: Text - Value: "where [ScriptId,TreeList,root=/sitecore/system/Modules/PowerShell/Script Library,specific script] returns a non-null value" + Value: | + where [ScriptId,TreeList,root=/sitecore/system/Modules/PowerShell/Script Library,specific script] returns a "true" value diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags.yml new file mode 100644 index 000000000..4c2ccb2ba --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags.yml @@ -0,0 +1,19 @@ +--- +ID: "a96b0241-65f0-494f-89f6-c5a769cbda48" +Parent: "d555657d-f954-497c-a293-65d5e695ab61" +Template: "96c8e5dd-63c3-496b-a97c-a3e37e1dacba" +Path: /sitecore/system/Settings/Rules/Definitions/Elements/PowerShell Editor Rules/Tags +DB: master +BranchID: "9a72c539-dbf8-4dad-96d3-a298fc04add6" +SharedFields: +- ID: "f6d8a61c-2f84-4401-bd24-52d2068172bc" + Hint: __Originator + Value: "{FD4268C6-E588-4C19-B141-B1AAD488887D}" +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20181020T161858Z diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags/Default.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags/Default.yml new file mode 100644 index 000000000..66ee0e308 --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Tags/Default.yml @@ -0,0 +1,23 @@ +--- +ID: "53d8bfe8-6a0e-45d2-a6e4-ea0ba47d27b9" +Parent: "a96b0241-65f0-494f-89f6-c5a769cbda48" +Template: "854ba861-63ea-4a0c-8c7b-541e9a7ec4c1" +Path: /sitecore/system/Settings/Rules/Definitions/Elements/PowerShell Editor Rules/Tags/Default +DB: master +BranchID: "9a72c539-dbf8-4dad-96d3-a298fc04add6" +SharedFields: +- ID: "42f77151-098f-496a-94cf-590b7edeeabe" + Hint: Tags + Type: Multilist + Value: "{F9CE8201-C7FD-4217-AC4A-45205CA80FAF}" +- ID: "f6d8a61c-2f84-4401-bd24-52d2068172bc" + Hint: __Originator + Value: "{6F0688E4-7B16-482F-845B-35836FD15D14}" +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20181020T161858Z diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Visibility.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Visibility.yml new file mode 100644 index 000000000..29d48021b --- /dev/null +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Visibility.yml @@ -0,0 +1,19 @@ +--- +ID: "bc88bbf4-ea57-41ff-bf37-bfd353dd5c3e" +Parent: "d555657d-f954-497c-a293-65d5e695ab61" +Template: "aa91a868-02f2-41d3-8b78-1cad91b4dcae" +Path: /sitecore/system/Settings/Rules/Definitions/Elements/PowerShell Editor Rules/Visibility +DB: master +BranchID: "9a72c539-dbf8-4dad-96d3-a298fc04add6" +SharedFields: +- ID: "f6d8a61c-2f84-4401-bd24-52d2068172bc" + Hint: __Originator + Value: "{283F6CD6-EFB8-47AC-946A-ABB17FA45ECB}" +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "25bed78c-4957-4165-998a-ca1b52f67497" + Hint: __Created + Value: 20181020T161858Z From d1f5e271c7087da6ffb2d5c5417bc62ea5c4aea3 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 22 Oct 2018 09:59:04 -0400 Subject: [PATCH 4/5] updated text --- .../PowerShell Editor Rules/Script Returns True Value.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml index 53e1ca42b..506af6c08 100644 --- a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml @@ -23,4 +23,4 @@ Languages: - ID: "af321234-4eb9-4ef5-9197-65903351939c" Hint: Text Value: | - where [ScriptId,TreeList,root=/sitecore/system/Modules/PowerShell/Script Library,specific script] returns a "true" value + where [ScriptId,TreeList,root=/sitecore/system/Modules/PowerShell/Script Library,specific PowerShell script] returns a "true" value From cf56a61886bb1dd0670245c1e28d312a9fdcf7b7 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 22 Oct 2018 10:58:01 -0400 Subject: [PATCH 5/5] update macro to tree rather than treelist --- .../PowerShell Editor Rules/Script Returns True Value.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml index 506af6c08..d008a8813 100644 --- a/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml +++ b/Cognifide.PowerShell/Data/Serialization/Rules/Editor Rules/PowerShell Editor Rules/Script Returns True Value.yml @@ -23,4 +23,4 @@ Languages: - ID: "af321234-4eb9-4ef5-9197-65903351939c" Hint: Text Value: | - where [ScriptId,TreeList,root=/sitecore/system/Modules/PowerShell/Script Library,specific PowerShell script] returns a "true" value + where [ScriptId,tree,root=/sitecore/system/Modules/PowerShell/Script Library,specific PowerShell script] returns a "true" value