【发布时间】:2017-05-29 15:49:59
【问题描述】:
我有我的自定义类的对象的 Arraylist。 怎么说函数param就是这个类的ArrayList?
function CreateArrays{
param(
[System.Collections.ArrayList] $collectionWithItems
)
}
我的意思类似于以下 C# 声明:
void SomeMethod ( List<myCustomClass> listOfObjects) { }
我知道我可以在 foreach 中投射对象:
foreach($item in [DataBaseItem]$collectionWithItems)
{
}
但是有没有办法在params中说出来?
【问题讨论】:
标签: xml powershell