Skip to content

ComObject Member-access enumeration #19854

@iRon7

Description

@iRon7

Summary of the new feature / enhancement

Coming from Stackoverflow question: Extract text from html with powershell
And probably ties into #4553 (which I simply don't fully understand)

Just like Member-Access Enumeration for native .Net and PowerShell objects, I would expect to be able to enumerate ComObject members (System.MarshalByRefObject?) in a similar way:

$String = '<div>Some text</div>'
$Unicode = [System.Text.Encoding]::Unicode.GetBytes($String)
$Html = New-Object -Com 'HTMLFile'
$Html.write($Unicode)
$Html.getElementsByTagName('div').innerText

Expected

Some Text

Actual

No output

Workarrounds

@($Html.getElementsByTagName('div')).innerText
$Html.getElementsByTagName('div') |% { $_.innerText }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productKeepOpenThe bot will ignore these and not auto-closeWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions