Hash table in powershell

18/01/2013 15:11

#array of hash table
$crawledProperties = (@{Name="ows_ChamLukasArticleDate"; VariantType=64},
         @{Name="ows_PublishingPageContent"; VariantType=31},
         @{Name="ows_ChamLukasCategory"; VariantType=31},
         @{Name="ows_ChamLukasTags"; VariantType=31},
         @{Name="ows_ChamLukasIntroductionText"; VariantType=31},
         @{Name="ows_ChamLukasAuthor"; VariantType=31})
$i=0        
foreach($cp in $crawledProperties)
{
 Write-Host $cp.Name
 Write-Host $cp.VariantType
 Write-Host ""
 
 #or
 Write-Host $crawledProperties[$i].Name
 $i++
}