logo
  • 教程列表
  • SO官方文档
  • 哈希表
    • 按键访问哈希表值
    • 创建哈希表
    • 将键值对添加到现有哈希表
    • 循环哈希表
    • 枚举键和键值对
    • 从现有哈希表中删除键值对
  1. StackOverflow 文档
  2. PowerShell 教程
  3. 哈希表
  4. 循环哈希表

循环哈希表

Created: November-22, 2018

$hashTable = @{
    Key1 = 'Value1'
    Key2 = 'Value2'
}

foreach($key in $hashTable.Keys)
{
    $value = $hashTable.$key
    Write-Output "$key : $value"
}
#Output
Key1 : Value1
Key2 : Value2
  • 枚举键和键值对
  • 将键值对添加到现有哈希表

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明