Skip to content

Commit c774e7c

Browse files
committed
Replace preprocessor directive in PathUtils
1 parent a2fc548 commit c774e7c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/PowerShellEditorServices/Utility/PathUtils.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55

66
using System.IO;
7+
using System.Runtime.InteropServices;
78

89
namespace Microsoft.PowerShell.EditorServices.Utility
910
{
@@ -32,11 +33,7 @@ internal static class PathUtils
3233
/// be "slash agnostic", we need to use the assumption that a '\' is the alternate path
3334
/// separator on Linux.
3435
/// </summary>
35-
#if CoreCLR
36-
internal static readonly char AlternatePathSeparator = System.Management.Automation.Platform.IsWindows ? '/' : '\\';
37-
#else
38-
internal static readonly char AlternatePathSeparator = '/';
39-
#endif
36+
internal static readonly char AlternatePathSeparator = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? '/' : '\\';
4037
internal static readonly string AlternatePathSeparatorString = AlternatePathSeparator.ToString();
4138

4239
/// <summary>

0 commit comments

Comments
 (0)