I still cannot understand fully, the fundamental idea within Powershell that says the object TYPE changes as one goes from Command A to Command B in a pipeline, and so on. Best to state my dilemma by way of example, because this has bugged me for days/weeks now:
(1) I have a simple CSV file, 4 properties, nothing out-of-the-ordinary or fancy:
> $Infile = MyFile.csv.
(2) I have the following 4 lines of "code":
$values = Import-Csv $Infile -Delimiter / | Where FullName -NE "" $values.Count $values | Get-Member Get-Member -InputObject $values
(3) Now the key distinction which I do not understand: last 3rd and the 4th lines. They are to me, the same. But they're not, according to Powershell.
(4) $values | Get-member — returns object TYPE PSCustomObject. Well and good, this what I'm used to most of the time. The methods and properties displayed are exactly what I was expecting.
(5) Get-Member -InputObject $values — returns System.Object – with many many more methods and properties, all of which are Greek to me. How so?
I am certainly missing some fundamental principle of Powershell processing. Would be grateful for any hints or advice to get my head straight on this. Thanking you all out there for your help.
You might re-review the help for Get-Member.
You must be logged in to reply to this topic.