Add cache for GetApplicationBase (#3969)

This commit is contained in:
Ilya
2017-06-20 15:08:02 -07:00
committed by Dongbo Wang
parent 5a84e60c13
commit 598cebf7b2
19 changed files with 59 additions and 69 deletions
@@ -1768,11 +1768,11 @@ namespace Microsoft.PowerShell.Commands
{
if (m.Name.Equals(moduleName, StringComparison.OrdinalIgnoreCase))
{
m.SetModuleBase(Utils.GetApplicationBase(Utils.DefaultPowerShellShellID));
m.SetModuleBase(Utils.DefaultPowerShellAppBase);
// Also set ModuleBase for nested modules of Engine modules
foreach (var nestedModule in m.NestedModules)
{
nestedModule.SetModuleBase(Utils.GetApplicationBase(Utils.DefaultPowerShellShellID));
nestedModule.SetModuleBase(Utils.DefaultPowerShellAppBase);
}
}
}
@@ -1781,11 +1781,11 @@ namespace Microsoft.PowerShell.Commands
{
if (m.Name.Equals(moduleName, StringComparison.OrdinalIgnoreCase))
{
m.SetModuleBase(Utils.GetApplicationBase(Utils.DefaultPowerShellShellID));
m.SetModuleBase(Utils.DefaultPowerShellAppBase);
// Also set ModuleBase for nested modules of Engine modules
foreach (var nestedModule in m.NestedModules)
{
nestedModule.SetModuleBase(Utils.GetApplicationBase(Utils.DefaultPowerShellShellID));
nestedModule.SetModuleBase(Utils.DefaultPowerShellAppBase);
}
}
}