tag:blogger.com,1999:blog-5384857.post830129644744919537..comments2023-10-10T03:52:55.494+01:00Comments on Under The Stairs: Determining If An Object Is An ArrayUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5384857.post-65616078315508723632009-01-19T20:28:00.000+00:002009-01-19T20:28:00.000+00:00What happens if you run this?$($gpos).gettype().Is...What happens if you run this?<BR/><BR/>$($gpos).gettype().IsArray<BR/><BR/>I know that if the collection has more than one item, PowerShell will convert it into an array. But I wonder what happens if there is only one item?Anonymoushttps://www.blogger.com/profile/15144351512413298258noreply@blogger.comtag:blogger.com,1999:blog-5384857.post-82014792749351382202009-01-18T17:32:00.000+00:002009-01-18T17:32:00.000+00:00The key here is that regardless of how many object...The key here is that regardless of how many objects a call to SearchGPOs() returns, its return type is always an IGPMGPOCollection object, which means that you will always get a collection returned. This is really just a function of this particular object model rather than something PowerShell (or even COM) is doing.gpoguyhttps://www.blogger.com/profile/11187022463344180140noreply@blogger.com