2
我尝试编写一个Powershell脚本,该脚本接受来自管道的目录作为命名参数。我的参数声明看起来像从管道传递目录作为Powershell命名参数
param([Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelinebyPropertyName=$true)] [System.IO.DirectoryInfo[]] $PsPath)
我的问题是通话
gci c:\ -Directory | MyScript
结果只有gci
结果的最后一个元素的输入数组中之中。这里有什么问题?
由于提前, 克里斯托夫