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:\>
Prepending a value to an array or hash in powershell
{ 0 comments… add one }
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:\>