@@ -24,7 +24,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
24
24
/// GetScriptAnalyzerRuleCommand: Cmdlet to list all the analyzer rule names and descriptions.
25
25
/// </summary>
26
26
[ Cmdlet ( VerbsCommon . Get , "ScriptAnalyzerRule" , HelpUri = "http://go.microsoft.com/fwlink/?LinkId=525913" ) ]
27
- public class GetScriptAnalyzerRuleCommand : PSCmdlet
27
+ public class GetScriptAnalyzerRuleCommand : PSCmdlet , IOutputWriter
28
28
{
29
29
#region Parameters
30
30
/// <summary>
@@ -82,43 +82,7 @@ public string[] Severity
82
82
/// </summary>
83
83
protected override void BeginProcessing ( )
84
84
{
85
- #region Set PSCmdlet property of Helper
86
-
87
- Helper . Instance . MyCmdlet = this ;
88
-
89
- #endregion
90
- // Verifies rule extensions
91
- if ( customizedRulePath != null )
92
- {
93
- validationResults = ScriptAnalyzer . Instance . CheckRuleExtension ( customizedRulePath , this ) ;
94
- foreach ( string extension in validationResults [ "InvalidPaths" ] )
95
- {
96
- WriteWarning ( string . Format ( CultureInfo . CurrentCulture , Strings . MissingRuleExtension , extension ) ) ;
97
- }
98
- }
99
- else
100
- {
101
- validationResults . Add ( "InvalidPaths" , new List < string > ( ) ) ;
102
- validationResults . Add ( "ValidModPaths" , new List < string > ( ) ) ;
103
- validationResults . Add ( "ValidDllPaths" , new List < string > ( ) ) ;
104
- }
105
-
106
- try
107
- {
108
- if ( validationResults [ "ValidDllPaths" ] . Count == 0 )
109
- {
110
- ScriptAnalyzer . Instance . Initialize ( ) ;
111
- }
112
- else
113
- {
114
- ScriptAnalyzer . Instance . Initilaize ( validationResults ) ;
115
- }
116
- }
117
- catch ( Exception ex )
118
- {
119
- ThrowTerminatingError ( new ErrorRecord ( ex , ex . HResult . ToString ( "X" , CultureInfo . CurrentCulture ) ,
120
- ErrorCategory . NotSpecified , this ) ) ;
121
- }
85
+ ScriptAnalyzer . Instance . Initialize ( this , customizedRulePath ) ;
122
86
}
123
87
124
88
/// <summary>
0 commit comments