🌳 My Digital Garden

Home

❯

programming

❯

powershell

❯

03 hashtable

03-hashtable

Mar 26, 20261 min read

https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-hashtable?view=powershell-7.6

$mydict = @{
	k1="123"
	k2=123
}
$mydict = @{k1="123";k2=123}

Key value

$mydict.Keys
$mydict.Values
$mydict.ContainsKey("k1") # check if key exist

Get/Set

$mydict.keyName
$mydict.keyName = 123
  • if a key is not found, no errors

Add new

$mydict.Add("key","value")

Custom Objects

$dog1 = [PSCustomObject]@{"name"="dog";"age"=21}
$dog1.name
$dog1.age

Graph View

Recent Notes

  • docs-template

    Apr 22, 2026

    • 3910

      Apr 22, 2026

      • Selfhost a Resilient Remote Access, Ditch Old VPN Protocols

        Apr 22, 2026

        Created with Quartz v4.5.2 © 2026

        • GitHub
        • Discord Community