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

从现有哈希表中删除键值对

Created: November-22, 2018

例如,使用 remove 运算符从哈希表中删除值为 Value2 的 Key2 键:

$hashTable = @{
    Key1 = 'Value1'
    Key2 = 'Value2'
}
$hashTable.Remove("Key2", "Value2")
$hashTable

#Output

Name                           Value
----                           -----
Key1                           Value1
  • 枚举键和键值对

Copyright © 2018. All right reserved

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

  • 关于我们
  • 免责声明