@@ -114,8 +114,8 @@ internal set
114
114
/// </summary>
115
115
private Helper ( )
116
116
{
117
- _ruleArguments = new Dictionary < string , Dictionary < string , object > > ( StringComparer . OrdinalIgnoreCase ) ;
118
117
_commandInfoCache = new Lazy < CommandInfoCache > ( ( ) => new CommandInfoCache ( ) ) ;
118
+ _ruleArguments = new Dictionary < string , Dictionary < string , object > > ( StringComparer . OrdinalIgnoreCase ) ;
119
119
_cmdletToAliasDictionary = new Dictionary < string , List < string > > ( StringComparer . OrdinalIgnoreCase ) ;
120
120
_aliasToCmdletDictionary = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
121
121
_keywordBlockDictionary = new Dictionary < string , List < Tuple < int , int > > > ( StringComparer . OrdinalIgnoreCase ) ;
@@ -129,7 +129,7 @@ private Helper()
129
129
/// A CommandInvocationIntrinsics instance for use in gathering
130
130
/// information about available commands and aliases.
131
131
/// </param>
132
- public Helper ( CommandInvocationIntrinsics invokeCommand ) : base ( )
132
+ public Helper ( CommandInvocationIntrinsics invokeCommand ) : this ( )
133
133
{
134
134
_invokeCommand = invokeCommand ;
135
135
}
@@ -140,6 +140,10 @@ public Helper(CommandInvocationIntrinsics invokeCommand) : base()
140
140
/// </summary>
141
141
public void Initialize ( )
142
142
{
143
+ _aliasToCmdletDictionary . Clear ( ) ;
144
+ _cmdletToAliasDictionary . Clear ( ) ;
145
+ _keywordBlockDictionary . Clear ( ) ;
146
+ VariableAnalysisDictionary . Clear ( ) ;
143
147
if ( _invokeCommand != null )
144
148
{
145
149
IEnumerable < CommandInfo > aliases = _invokeCommand . GetCommands ( "*" , CommandTypes . Alias , nameIsPattern : true ) ;
0 commit comments