-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
This behavior is something I just came across while utilizing mshtml.HTMLDocumentClass.
Prior to Preview 2, fields that were seen as having values of False were not considered the same as [BDNull]::Value.
Since Preview 2 through the current 5, these fields are now seen as equivalent to [DBNull]
Attached a sample ChromeBookmark export file I used for these.
PowerShell 5 Example With Results
$BK = New-Object -Com "HTMLFile"
$BK.IHTMLDocument2_write($(Get-Content .\ChromeBKSample.txt -Raw))
$BKL = $BK.links[0]
($BKL.attributes("disabled")).nodeValue
False
($BKL.attributes("disabled")).nodeValue -eq [DBNull]::Value
FalsePowerShell 7 Preview 5 Example With Results (And alterations needed to make it work with PSH6+)
Add-Type -Path "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll"
$BK = New-Object mshtml.HTMLDocumentClass
$BK.IHTMLDocument2_write($(Get-Content .\ChromeBKSample.txt -Raw))
$BKL = $BK.links.item(0)
($BKL.attributes.item("disabled")).nodeValue
False
# This used to return "False", but since Preview 2 now returns True, despite also showing it as having a value of False:
($BKL.attributes.item("disabled")).nodeValue -eq [DBNull]::Value
True
Possibly related to changes from other issues?: #9561, #9794, #10404
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime