Skip to content

Commit b700465

Browse files
committed
Prevent permissions problem reading bins for version
1 parent dced589 commit b700465

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Collection/CompatibilityProfileCollector.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
using Microsoft.PowerShell.CrossCompatibility.Utility;
1313
using SMA = System.Management.Automation;
1414

15+
#if CoreCLR
16+
using System.Runtime.InteropServices;
17+
#endif
18+
1519
namespace Microsoft.PowerShell.CrossCompatibility.Collection
1620
{
1721
/// <summary>
@@ -209,7 +213,11 @@ public IEnumerable<KeyValuePair<string, NativeCommandData>> GetNativeCommandData
209213
Path = command.Path
210214
};
211215

216+
#if CoreCLR
217+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
218+
#else
212219
if (_platformInfoCollector.PSVersion.Major >= 5)
220+
#endif
213221
{
214222
commandData.Version = _getApplicationVersion(command);
215223
}

0 commit comments

Comments
 (0)