Title: Feature Request: Improved [DBNull]::Value comparison · Issue #10404 · PowerShell/PowerShell · GitHub
Open Graph Title: Feature Request: Improved [DBNull]::Value comparison · Issue #10404 · PowerShell/PowerShell
X Title: Feature Request: Improved [DBNull]::Value comparison · Issue #10404 · PowerShell/PowerShell
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 wit...
Open Graph 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 w...
X 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 w...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10404
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature Request: Improved [DBNull]::Value comparison","articleBody":"# Summary of the new feature/enhancement\r\n\r\nAs 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.\r\n\r\nA practical example. Let's say I have a CMDB with dbnull in a few spots I want to do comparisons:\r\n\r\n```powershell\r\n#Example scenario with a function that uses Invoke-Sqlcmd2 to pull data\r\n Get-XXXXServer | Where-Object{$_.VCNumCPUs -gt 8}\r\n #Error for every line where VCNumCPU has DBNull value\r\n\r\n #workaround before recent dbnull handling fix\r\n Get-XXXXServer | Where-Object{[string]$_.VCNumCPUs -and $_.VCNumCPUs -gt 8}\r\n```\r\n\r\nThere is precedence for this: `$null -gt 10` is `$false`, and `10 -gt $null` is `$true`\r\n\r\nCheers!","author":{"url":"https://github.com/RamblingCookieMonster","@type":"Person","name":"RamblingCookieMonster"},"datePublished":"2019-08-21T19:02:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/10404/PowerShell/issues/10404"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:35c7f194-4aaa-8fd4-684a-5b4c9918b421 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D460:EAF1C:12B6E66:191FA71:6A5B0630 |
| html-safe-nonce | 655e92ba9afd2e816099b8f3b76e1ea3b78ab3104f566839b364b562f845e69f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDYwOkVBRjFDOjEyQjZFNjY6MTkxRkE3MTo2QTVCMDYzMCIsInZpc2l0b3JfaWQiOiI1MTIwMjk4MDY0OTE3OTcwNDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0d94f999436062ebb14f946dd522535489f2e1cb41919e2ef869afc34d9b198a |
| hovercard-subject-tag | issue:483598650 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/10404/issue_layout |
| twitter:image | https://opengraph.githubassets.com/45cf430a79e7898e4bccac9cc8576cd2316c22c6ee1298aaff2bc1296b61ba40/PowerShell/PowerShell/issues/10404 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/45cf430a79e7898e4bccac9cc8576cd2316c22c6ee1298aaff2bc1296b61ba40/PowerShell/PowerShell/issues/10404 |
| og:image:alt | 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 w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RamblingCookieMonster |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width