I have a powershell class that has method that can return an array of custom PSObjects, though I'm not sure how to define the method so that it won't complain. ie
class ThisIsAClass {
MethodReturnsArray() {
$thisArray = @()
for ($i=0; $i -lt $total; $i++) {
$item = New-Object -TypeName PSObject
$item | Add-Member MemberType -NoteProperty -Name ID -Value i
$item | Add-Member MemberType -NoteProperty -Name Text -Value "a"
}
return $thisArray
}
}