Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types that implement IDynamicMetaObjectProvider do not have the standard hidden PSObject members such as .psobject and .pstypenames #10668

Open
mklement0 opened this issue Oct 1, 2019 · 0 comments

Comments

@mklement0
Copy link
Contributor

commented Oct 1, 2019

Types that implement IDynamicMetaObjectProvider do not have the standard, hidden PSObject members such as .psobject and pstypenames, which one would expect to be present on any object (other than $null).

@SeeminglyScience points out that "in most cases PowerShell is going to let JObject [a type that implements IDynamicMetaObjectProvider] decide how it's bound", so the problem may be related to that.

Steps to reproduce

# Instantiate a type that implements IDynamicMetaObjectProvider
$obj = [Newtonsoft.Json.Linq.JObject]::Parse('{"foo":1}')

$obj.psobject | Should -Not -BeNullOrEmpty
$obj.pstypenames | Should -Not -BeNullOrEmpty

Expected behavior

Both tests should succeed.

Actual behavior

Both tests fail, because the .psobject and .pstypenames properties unexpectedly don't exist.

Environment data

PowerShell Core 7.0.0-preview.4
Windows PowerShell v5.1.18362.145
@mklement0 mklement0 changed the title Types that implement IDynamicMetaObjectProvider do not have the standard, hidden PSObject members such as `.psobject` and `pstypenames` Types that implement IDynamicMetaObjectProvider do not have the standard hidden PSObject members such as `.psobject` and `pstypenames` Oct 1, 2019
@mklement0 mklement0 changed the title Types that implement IDynamicMetaObjectProvider do not have the standard hidden PSObject members such as `.psobject` and `pstypenames` Types that implement IDynamicMetaObjectProvider do not have the standard hidden PSObject members such as .psobject and .pstypenames Oct 1, 2019
@iSazonov iSazonov added the Area-Engine label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.