zcl_ccc 发表于 2018-9-3 10:44:23

Powershell学习笔记3——hashtable

PS (2) > $foo = @{  >> a = 1
  >> b = 2
  >> c = 3
  >> }
  >>
  PS (3) > $foo
  Key Value
  --- -----
  a 1
  b 2
  c 3
  Now assign $foo to $bar and verify that it matches $foo as we expect.
  PS (4) > $bar = $foo
  PS (5) > $bar
  Key Value
  --- -----
  a 1
  b 2
  c 3
  Next assign a new value to the element "a" in $foo.
  PS (6) > $foo.a = "Hi there"
  PS (7) > $foo.a
  Hi there
  And let’s look at what happened to $bar:
  PS (8) > $bar.a
  Hi there
  PS (9) > $bar
  Key Value
  --- -----
  a Hi there
  b 2
  c 3
  The change that was made to $foo has been reflected in $bar.

页: [1]
查看完整版本: Powershell学习笔记3——hashtable