Skip to content

ComObject Member-access enumeration #19854

Open

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 }

Activity

  1. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Jun 24, 2023
  2. iRon7 commented on Jul 18, 2023

    @iRon7
    Author

    I think this issue slipped through.
    Can it be assigned, relabeled, answered (or even rejected/resolved/"Won't fix" if not valid)?

  3. iSazonov commented on Jul 18, 2023

    @iSazonov
    Collaborator
  4. added
    Issue-BugIssue has been identified as a bug in the product
    and removed
    Issue-Enhancementthe issue is more of a feature request than a bug
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Jul 18, 2023
  5. SeeminglyScience commented on Jul 18, 2023

    @SeeminglyScience
    Contributor

    I think this issue slipped through. Can it be assigned, relabeled, answered (or even rejected/resolved/"Won't fix" if not valid)?

    It's a bug for sure. I'd like to fix it, but the COM binder is by far the most complicated of the binders (and is mostly lifted directly from the BCL) and the binders are already pretty complicated.

    No promises but I'm building some tools in spare time that make it easier examine COM objects and what they implement. Don't hold your breath for a fix, but I also don't want to mark it wontfix.

  6. iRon7 commented on Jan 15, 2024

    @iRon7
    Author

    This bug still exists

  7. iRon7 commented on Jul 15, 2024

    @iRon7
    Author

    Getting a little bit tired of fighting the microsoft-github-policy-service bot 😫.
    Anyways, this issue still exists in:

    Name                           Value
    ----                           -----
    PSVersion                      7.4.3
    PSEdition                      Core
    GitCommitId                    7.4.3
    OS                             Microsoft Windows 10.0.19045
    Platform                       Win32NT
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  8. added
    WG-Enginecore PowerShell engine, interpreter, and runtime
    KeepOpenThe bot will ignore these and not auto-close
    on Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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