diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 088519c37..2dbf04085 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -3,8 +3,13 @@ function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } -function vcpkgHasProperty([Parameter(Mandatory=$true)]$object, [Parameter(Mandatory=$true)]$propertyName) +function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { + if ($object -eq $null) + { + return $false + } + return [bool]($object.psobject.Properties | where { $_.Name -eq "$propertyName"}) } |
