Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

PowerTip: Add Two PowerShell Arrays Together

$
0
0

Summary: Easily add two Windows PowerShell arrays together.

Hey, Scripting Guy! Question If I have an array stored in one variable, and another array stored in another variable, how can I add them together?

Hey, Scripting Guy! Answer Use the + operator to add to arrays together:

PS C:\> $a = 2,3,4

PS C:\> $b = 5,6,7

PS C:\> $c = $a + $b

PS C:\> $c

2

3

4

5

6

7

PS C:\>


Viewing all articles
Browse latest Browse all 34890

Trending Articles