拿這個作爲一個例子:
$var = "one","two","three"
0..2 | select-object $var[$_]
Index operation failed; the array index evaluated to null.
At line:1 char:27
+ 0..2 | select-object $var[ <<<< $_]
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArrayIndex
爲什麼$ _空?
啊啊foreach。這樣做的工作。謝謝。 :) –
總是樂意幫忙! –