mirror of
https://github.com/sinbad/UEScripts.git
synced 2025-02-23 21:15:24 +00:00
29 lines
502 B
PowerShell
29 lines
502 B
PowerShell
# Simplify platform checks for Powershell < 6
|
|
if (-not $PSVersionTable.Platform) {
|
|
# This is Windows-only powershell
|
|
$global:IsWindows = $true
|
|
$global:IsLinux = $false
|
|
$global:IsMacOS = $false
|
|
}
|
|
|
|
|
|
$exeSuffix = ""
|
|
$batchSuffix = ".sh"
|
|
if ($IsWindows) {
|
|
$exeSuffix = ".exe"
|
|
}
|
|
if ($IsWindows) {
|
|
$batchSuffix = ".bat"
|
|
}
|
|
|
|
|
|
function Get-Platform {
|
|
if ($IsWindows) {
|
|
return "Win64"
|
|
} elseif ($IsLinux) {
|
|
return "Linux"
|
|
} else {
|
|
return "Mac"
|
|
}
|
|
}
|