Allow use of build module on unknown Linux distros (#11146)

This commit is contained in:
Krzysztof Bogacki 2020-05-29 02:31:56 +02:00 committed by GitHub
parent c602f8272e
commit 9e0b940cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,11 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
# Skips a check that prevents building PowerShell on unsupported Linux distributions
[parameter(Mandatory = $false)][switch]$SkipLinuxDistroCheck = $false
)
Set-StrictMode -Version 3.0
# On Unix paths is separated by colon
@ -178,7 +183,11 @@ function Get-EnvironmentInformation
$environment.IsSUSEFamily -or
$environment.IsAlpine)
) {
throw "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell."
if ($SkipLinuxDistroCheck) {
Write-Warning "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell."
} else {
throw "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell. Import this module with '-ArgumentList `$true' to bypass this check."
}
}
}