From b00bfffa74c5ad0a51ee3ca9fee69ffedb8208fd Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Tue, 1 Sep 2015 11:39:43 -0700 Subject: [PATCH] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 9a2d3a0d3..5a71b127c 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ If you have previous version of PSScriptAnalyzer installed on your machine, you To confirm installation: run ```Get-ScriptAnalyzerRule``` in the PowerShell console to obtain the built-in rules + Suppressing Rules ================= @@ -118,6 +119,7 @@ To match all functions/variables/parameters/objects, use `*` as the value of the ) + Profile support in ScriptAnalyzer ======================================== @@ -139,6 +141,32 @@ $myProfile = @{ Invoke-ScriptAnalyzer -path MyScript.ps1 -Profile $myProfile ``` +ScriptAnalyzer as a .net library +================================ + +ScriptAnalyzer engine and functionality can now be directly consumed as a library. + +Here are the public interfaces: + +```c# +using Microsoft.Windows.PowerShell.ScriptAnalyzer; + +public void Initialize(System.Management.Automation.Runspaces.Runspace runspace, +Microsoft.Windows.PowerShell.ScriptAnalyzer.IOutputWriter outputWriter, +[string[] customizedRulePath = null], +[string[] includeRuleNames = null], +[string[] excludeRuleNames = null], +[string[] severity = null], +[bool suppressedOnly = false], +[string profile = null]) + +public System.Collections.Generic.IEnumerable AnalyzePath(string path, +[bool searchRecursively = false]) + +public System.Collections.Generic.IEnumerable GetRule(string[] moduleNames, +string[] ruleNames) +``` + Building the Code =================