Fix build module for removal of Platform module

This commit is contained in:
Andrew Schwartzmeyer committed 2016-04-08 15:13:50 -07:00
1 parent bcdad12c04
commit 13e0760e16
1 file changed
+5 -3
+5 -3
View File
@@ -1,7 +1,5 @@
# Use the .NET Core APIs to determine the current platform; if a runtime
# exception is thrown, we are on FullCLR, not .NET Core.
#
# TODO: import Microsoft.PowerShell.Platform instead
try {
$Runtime = [System.Runtime.InteropServices.RuntimeInformation]
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
@@ -10,12 +8,16 @@ try {
$IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux)
$IsOSX = $Runtime::IsOSPlatform($OSPlatform::OSX)
$IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows)
} catch [System.Management.Automation.RuntimeException] {
} catch {
# If these are already set, then they're read-only and we're done
try {
$IsCore = $false
$IsLinux = $false
$IsOSX = $false
$IsWindows = $true
}
catch { }
}
function Start-PSBuild {