Skip to content

Commit 69dc99a

Browse files
author
Maddie Clayton
authored
Merge pull request #4 from Azure/maddieclayton-patch-1
Enable tests to run with "AzureRm" prefix in NetCore
2 parents 60812e0 + 4c29ed3 commit 69dc99a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ScenarioTest.ResourceManager/EnvironmentSetupHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,13 @@ private void SetupPowerShellModules(System.Management.Automation.PowerShell powe
667667
foreach (string moduleName in modules)
668668
{
669669
powershell.AddScript(string.Format("Import-Module \"{0}\"", moduleName.AsAbsoluteLocation()));
670+
if (moduleName.EndsWith(".psd1"))
671+
{
672+
#if NETSTANDARD
673+
var moduleShortName = moduleName.Split(new string[] { "\\" }, StringSplitOptions.None).Last().Split(new string[] { "/" }, StringSplitOptions.None).Last();
674+
powershell.AddScript("Enable-AzureRmAlias -Module " + moduleShortName.Substring(0, moduleShortName.Length - 5));
675+
#endif
676+
}
670677
}
671678

672679
powershell.AddScript(

0 commit comments

Comments
 (0)