Catch exception when used on FullCLR
This is the case when the module is used on FullCLR versions of PowerShell (necessarily on Windows).
This commit is contained in:
parent
472b17d547
commit
a7177c24e2
@ -1,9 +1,15 @@
|
||||
# TODO: use PowerShell to check OS when available
|
||||
try {
|
||||
$Runtime = [System.Runtime.InteropServices.RuntimeInformation]
|
||||
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
|
||||
$Linux = $Runtime::IsOSPlatform($OSPlatform::Linux)
|
||||
$OSX = $Runtime::IsOSPlatform($OSPlatform::OSX)
|
||||
$Windows = $Runtime::IsOSPlatform($OSPlatform::Windows)
|
||||
} catch [System.Management.Automation.RuntimeException] {
|
||||
$Linux = $false
|
||||
$OSX = $false
|
||||
$Windows = $true
|
||||
}
|
||||
|
||||
function Start-PSBuild
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user