I found the answer.
$intArr = Select-Object -ExpandProperty intMember
Question
Suppose I have the following setup:
$arr = @()
for($i=0;$i -lt 100; $i++) {
$obj = New-Object myType
$obj.intMember = $i
$arr += $obj
}
And I want to turn this into an array of integers. My approach would be:
$intArr = Select-Object intMember
But this doesn't seem to be doing what I want. How do I get an actual integer array from this?
Solution
I found the answer.
$intArr = Select-Object -ExpandProperty intMember