0
我嘗試將其他屬性添加到select-object
輸出。但是,它有以下錯誤?爲「select-object」添加其他屬性?
Select-Object:無法找到接受參數'System.Object []'的位置參數。
$c = @{a = "...","...","..."; b = "...","...","..."}
$files |
% {
$filepath = $_.fullname
write-host $filepath
$type = getType $_.name
# The following statement works
Import-Csv $_ | select $c[$type] | OUT-GRIDVIEW
# The following doesn't work
Import-Csv $_ | select $c[$type] -property @{n="File"; e={$filepath}}| out-gridview
}
單曲elect @($ c [$ type]; @ {n =「File」; e = {$ filepath}})' – PetSerAl
'「...」'表示一個變量名? –