How do I create array of arrays in PowerShell?

前端 未结 1 2001
难免孤独
难免孤独 2020-12-03 17:06

I want to create an array of arrays in PowerShell.

$x = @(
    @(1,2,3),
    @(4,5,6)
)

It works fine. However, sometimes I have only one a

相关标签:
1条回答
  • 2020-12-03 17:21

    Adding a comma force to create an array:

    $x = @(
        ,@(1,2,3)
    )
    

    Simple way:

    $x = ,(1,2,3)
    
    0 讨论(0)
提交回复
热议问题