Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - why doesn't System.Collections.SortedList work in PowerShell

Reply
 
Old 10-30-2008   #1 (permalink)
RickB


 
 

why doesn't System.Collections.SortedList work in PowerShell

I'm doing this in CTP2 and the properties don't return any results.

$a = new-object System.Collections.SortedList
$a.add((get-date),1)
$a.add([datetime]'12/31/2009',2)

gm -in $a
TypeName: System.Collections.SortedList

Name MemberType Definition
---- ---------- ----------
Add Method System.Void Add(Object key,
Object value)
Clear Method System.Void Clear()
Clone Method System.Object Clone()
Contains Method System.Boolean Contains(Object
key)
ContainsKey Method System.Boolean ContainsKey(Object
key)
ContainsValue Method System.Boolean
ContainsValue(Object value)
CopyTo Method System.Void CopyTo(Array array,
Int32 arrayIndex)
Equals Method System.Boolean Equals(Object obj)
GetByIndex Method System.Object GetByIndex(Int32
index)
GetEnumerator Method
System.Collections.IDictionaryEnumerator GetEnumerator()
GetHashCode Method System.Int32 GetHashCode()
GetKey Method System.Object GetKey(Int32 index)
GetKeyList Method System.Collections.IList
GetKeyList()
GetType Method System.Type GetType()
GetValueList Method System.Collections.IList
GetValueList()
IndexOfKey Method System.Int32 IndexOfKey(Object
key)
IndexOfValue Method System.Int32 IndexOfValue(Object
value)
Remove Method System.Void Remove(Object key)
RemoveAt Method System.Void RemoveAt(Int32 index)
SetByIndex Method System.Void SetByIndex(Int32
index, Object value)
ToString Method System.String ToString()
TrimToSize Method System.Void TrimToSize()
Item ParameterizedProperty System.Object Item(Object key)
{get;set;}
Capacity Property System.Int32 Capacity {get;set;}
Count Property System.Int32 Count {get;}
IsFixedSize Property System.Boolean IsFixedSize {get;}
IsReadOnly Property System.Boolean IsReadOnly {get;}
IsSynchronized Property System.Boolean IsSynchronized
{get;}
Keys Property System.Collections.ICollection
Keys {get;}
SyncRoot Property System.Object SyncRoot {get;}
Values Property System.Collections.ICollection
Values {get;}

gm -in $a.keys
Get-Member : No object has been specified to get-member.
At line:1 char:3
+ gm <<<< -in $a.keys

gm -in $a.count
Get-Member : No object has been specified to get-member.
At line:1 char:3
+ gm <<<< -in $a.count

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Initializing a generic SortedList with sorted data .NET General
System restore and other system apps do not work Vista General
System.Collections.Generic.List<int> myList = new System.Collections.Generic.List<int>(100); .NET General
Generics and collections .NET General
How to put PSObject into System.Collections.ObjectModel.Collection PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46