문제

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?

도움이 되었습니까?

해결책

I found the answer.

$intArr = Select-Object -ExpandProperty intMember
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top