Quantcast
Viewing all articles
Browse latest Browse all 36188

PowerTip: Add Two PowerShell Arrays Together

Summary: Easily add two Windows PowerShell arrays together.

Image may be NSFW.
Clik here to view.
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?

Image may be NSFW.
Clik here to view.
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:\>

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 36188

Trending Articles