PowerShell数组 哈希表简单说明


$list=new-object -typename System.Collections.ArrayList #有add方法可变
$array=@(1,2,3,4,5)  #固定大小
foreach($item in $array)  #遍历
{
Write-Host $item
}
$hash=@{Name="wang lang";Age=28;} #哈希表 我常用在查看前后差异
$hash.Name
$hash.Count
$hash.Keys
$hash.Values
$hash["Name"]
本文链接: https://www.pstips.net/array-and-hashtable.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注