How to instantiate an unknown amount of objects in powershell : I have a question regarding the object creation in powershell version 5.
To simplify my question I am providing the exact java code I want to functionally realize.
I know, Java and powershell have nothing in common besides being object-oriented and I don't care for how this can be achieved syntactically but I hope it will help understand my intention.

        Scanner scan = new Scanner(System.in);
        System.out.println("How many argument lists do you want to provide?");
        int i = Integer.parseInt(scan.next());
        List<List<String>> list = new ArrayList<>();
        for(int j = 0; j < i; j++)
        {
            list.add(new ArrayList<String>()); // this is the exact point if don't know how to substantiate in powershell
            list.get(j).add(scan.next());
            // more arguments to be entered
        }

The actual intention in powershell is to parse user provided arguments with Read-Host and build a list of list of Strings containing them. Each list shall contain arguments for one powershell command. 

I hope this is understandable and someone can provide a solution. I will gladly provide more explanation if I couldn't make myself clear yet.



