Skip to content

Instantly share code, notes, and snippets.

@ivanignatiev
Created December 29, 2020 15:33
Show Gist options
  • Save ivanignatiev/6e347d7a302c3567de562f085c3c6f0b to your computer and use it in GitHub Desktop.
Save ivanignatiev/6e347d7a302c3567de562f085c3c6f0b to your computer and use it in GitHub Desktop.
Test: PowerShell Hashtables Merge
function Get-HashtablePartOne {
return @{
"a" = "a_value"
"c" = "c_value"
}
}
function Get-HashtablePartTwo {
return @{
"b" = "b_value"
"d" = "d_value"
}
}
$testHashtable = New-Object System.Collections.Hashtable
$testHashtable += Get-HashtablePartOne
$testHashtable += Get-HashtablePartTwo
$testHashtable
$testHashtable["a"]
$testHashtable["b"]
$testHashtable["c"]
$testHashtable["d"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment