keppla
keppla

Reputation: 1751

What Type does Powershells `Get-Member` show

I use PowerShell to write a database exporter.

I have DataRows, serialized via Export-Clixml 'data.xml'. These DataRows have a column value.

I read the first row via $row = (Import-Clixml 'data.xml')[0].

If I check for it's Type, via $row.value -is [System.Management.Automation.PSCustomObject] I get True

If I use Get-Member on value, like $row.value | Get-Member, I get the Output

 TypeName: Deserialized.System.DBNull

I kind of expected this to be System.Management.Automation.PSCustomObject.

Where does the type Get-Member shows me come from?

Upvotes: 1

Views: 75

Answers (1)

briantist
briantist

Reputation: 47792

If you look at $row.value.PSObject.TypeNames you'll probably see that Deserialized.System.DBNull is the first in the list.

Also see this answer from Keith Hill and the MSDN on the TypeNames property.

Upvotes: 2

Related Questions