≡ Menu

Prepending a value to an array or hash in powershell

PS C:\> $arr = @()
PS C:\> $arr += "hello"
PS C:\> $arr += "world"
PS C:\> $arr
hello
world
PS C:\> $arr = ,"well" + $arr
PS C:\> $arr
well
hello
world
PS C:\>
{ 0 comments… add one }

Leave a Comment