-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more
Description
Summary of the new feature/enhancement
As a PowerShell user, I expect some (many!) conveniences with regards to comparisons and type conversions. [dbnull]::value has had some improvement recently with #9794 but could use improvements with other comparisons, e.g. [dbnull]::value -gt 10 should not error out, at least from my perspective.
A practical example. Let's say I have a CMDB with dbnull in a few spots I want to do comparisons:
#Example scenario with a function that uses Invoke-Sqlcmd2 to pull data
Get-XXXXServer | Where-Object{$_.VCNumCPUs -gt 8}
#Error for every line where VCNumCPU has DBNull value
#workaround before recent dbnull handling fix
Get-XXXXServer | Where-Object{[string]$_.VCNumCPUs -and $_.VCNumCPUs -gt 8}There is precedence for this: $null -gt 10 is $false, and 10 -gt $null is $true
Cheers!
mklement0 and ConstantineK
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more