Selecting elements from a hashtable

Individual elements may be selected by key. A number of different formats are supported for selecting elements:

$hashtable["Key1"] 

Using dot notation, we have the following:

$hashtable.Key1 

The key is not case sensitive, but it is type sensitive and will not automatically convert. For instance, consider the following hashtable:

$hashtable = @{1 = 'one'} 

The value 1 can be selected if an integer is used as the key, but not if a string is used. In other words, the following works:

$hashtable.1 
$hashtable[1] 

The following approach, however, does not:

$hashtable."1" 
$hashtable["1"] 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.160.216