mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-30 20:59:12 +08:00
25 lines
529 B
PowerShell
25 lines
529 B
PowerShell
function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName)
|
|
{
|
|
if ($object -eq $null)
|
|
{
|
|
return $false
|
|
}
|
|
|
|
return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"})
|
|
}
|
|
|
|
function getProgramFiles32bit()
|
|
{
|
|
$out = ${env:PROGRAMFILES(X86)}
|
|
if ($out -eq $null)
|
|
{
|
|
$out = ${env:PROGRAMFILES}
|
|
}
|
|
|
|
if ($out -eq $null)
|
|
{
|
|
throw "Could not find [Program Files 32-bit]"
|
|
}
|
|
|
|
return $out
|
|
} |