Skip to content

PSGetMember binder generates a loose restriction rule that cause ETS member access to fail after a COM member access #4607

@daxian-dbw

Description

@daxian-dbw

Steps to reproduce

Assume there is at least one file in the folder F:\tmp

$shell = New-Object -ComObject "Shell.Application"
$folder = $shell.Namespace("F:\tmp")
$item = $folder.Items().Item(0)
$item | % { $_.Name }

$s = Add-Member -InputObject "abc" -MemberType NoteProperty -Name Name -Value "Hello" -PassThru
$s.Name

Expected behavior

PS:2> $s.Name
Hello

Actual behavior

Return nothing

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
GitCommitId                    v6.0.0-beta.3-30-gece27ff68798f508c755ccb84be5ae78b386ac82
OS                             Microsoft Windows 10.0.15063
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-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