I have a question regarding 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 how this can be achieved syntactically.
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.