I am trying to insert strings into an array of an array but it's not working. Here is what I'm trying to do:
[string[]] $workArray::new(6,2)
$workArray[0,1] = "C:\Users\"
$workArray[0,2] = "Document.xlsm"
However I'm getting this error: "Unable to index into an object of type System.String."
Any suggestions I'll be forever grateful!
$workArray = [string[,]]::new(6, 2)$workArray[0, 0]and$workArray[0, 1]for the code in the example. If you get into the habit of putting a space after a comma, it makes it easier to read.$workArray =New-Object 'string[,]' 6, 2