Skip to content

Commit c34ff8f

Browse files
committed
Fix TDD test and make code more x-plat compliant to fix some ModuleDependency tests that are currently disabled on Linux
1 parent 19b315d commit c34ff8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Engine/Generic/ModuleDependencyHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#if !PSV3
55
using System;
66
using System.Collections.Generic;
7-
using System.Collections.ObjectModel;
87
using System.IO;
98
using System.Linq;
109
using System.Management.Automation;
1110
using System.Management.Automation.Language;
1211
using System.Management.Automation.Runspaces;
12+
using System.Runtime.InteropServices;
1313

1414
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
1515
{
@@ -75,7 +75,7 @@ private set
7575
#if CORECLR
7676
localAppdataPath
7777
= string.IsNullOrWhiteSpace(value)
78-
? Environment.GetEnvironmentVariable("LOCALAPPDATA")
78+
? Environment.GetEnvironmentVariable(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "LOCALAPPDATA" : "HOME") //Environment.GetEnvironmentVariable("LOCALAPPDATA")
7979
: value;
8080
#else
8181
localAppdataPath
@@ -215,7 +215,7 @@ private string GetTempModulePath(string symLinkPath)
215215
private void SetupPSModulePath()
216216
{
217217
oldPSModulePath = Environment.GetEnvironmentVariable("PSModulePath");
218-
curPSModulePath = oldPSModulePath + ";" + tempModulePath;
218+
curPSModulePath = oldPSModulePath + Path.PathSeparator + tempModulePath;
219219
#if CORECLR
220220
Environment.SetEnvironmentVariable("PSModulePath", curPSModulePath);
221221
#else

0 commit comments

Comments
 (0)