Arrays 在数组索引中调用函数

Arrays 在数组索引中调用函数,arrays,function,powershell,Arrays,Function,Powershell,这次是短的。为什么这样不行 Function identity($x){$x} @(1,2,3)[identity(1)] (这些确实有效) 您需要先将其置于括号中,使其执行identity(1) @(1,2,3)[(identity(1))] @(1,2,3)[(identity(1))]

这次是短的。为什么这样不行

Function identity($x){$x}
@(1,2,3)[identity(1)]
(这些确实有效)


您需要先将其置于括号中,使其执行
identity(1)

@(1,2,3)[(identity(1))]
@(1,2,3)[(identity(1))]