Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to add/merge two hash tables in PowerShell?
Adding values of the hash table is simple as the adding string. We just need to use the addition operator (+) to merge two hash table values.
Here, we have two hash tables: $htable and $htable1.
$htable = [Ordered]@{EmpName="Charlie";City="New York";EmpID="001"}
$htable1 = [Ordered]@{Fruit='Apple';Color='Red'}
We will now add two hash tables,
$htable + $htalble1
PS C:\WINDOWS\system32> $htable+$htable1 Name Value ---- ----- EmpName Charlie City New York EmpID 001 Fruit Apple Color Red
Advertisements
