No you can't do foreach, "object" doesn't inherit from Ienumerable
"Shay Levy [MVP]" wrote:
Quote:
> Hi AgentM,
>
>
> I can't tell much about C# but in PowerShell I would use the foreach statment,
> I guess you can do the same in C#:
>
> foreach($o in $objPsNoteProperty ) {$o.propertyName ...}
>
>
>
>
> ---
> Shay Levy
> Windows PowerShell MVP
> http://blogs.microsoft.co.il/blogs/ScriptFanatic
>
>
>
> A> I am using C# to build a cmdlet.
> A>
> A> "AgentM" wrote:
> A> Quote:
Quote:
> >> I have a PSObject being returned that has a PsnoteProperty added. the
> >> Value of this PsNoteProperty is a Collection of PSObjects.
> >>
> >> PsObject.Properties.Add( new PsProperty("Name",Value))
> >>
> >> Now when I try to read this Value, it comes in as a object. How do I
> >> loop through these objects?
> >>
>
>
>