Normally I can get the PropertyNames of a PSObject
like this:
$xy.PSObject.Properties | Select-Object -Expand Name
However, I get a PSObject
from a Invoke-Sqlcmd
like this:
$GetQueryNormeinsatz = "SELECT ARTIKEL_NR as ArtNo, SMW1 as NameDE, SMN2 as BreiteVon FROM SOMEWHERE
$GetDataNormeinsatz = Invoke-Sqlcmd -ConnectionString $ConnectionLogik -Query $GetQueryNormeinsatz
Now when I do this:
$GetDataNormeinsatz.PSObject.Properties | select -expand Name
I would expect it to return
ArtNo
NameDE
BreiteVon
However, it returns this:
Count
Length
LongLength
Rank
SyncRoot
IsReadOnly
IsFixedSize
IsSynchronized
Why? And how can I get my desired ouput? Thx!