This should be simple but powershell is not giving me a valid output. I am open to other ways to handle this issue. in a high level I need something I can utilize from a parameter of a function if another option is suggested.
here is what I am trying to do:
$PrinterPermissions =
@(
@('Administrators', 'ManagePrinters','Allow'),
@('Power Users', 'ManagePrinters','Allow'),
@('Print Operators', 'ManagePrinters','Allow'),
@('OHD – Network Support Team', 'ManagePrinters','Allow'),
@("OHD – PC Support Team", 'ManageDocuments','Allow'),
@("OHD - Service Desk Users", 'ManageDocuments','Allow')
)
$PrinterPermissions += @("gprt_PrinterA","ManageDocuments","Allow")
To Access the object I am expecting to to call it like:
$PrinterPermissions[0][0] *= Administrators*
$PrinterPermissions[0][1] *= ManagePrinters*
$PrinterPermissions[0][2] *= Allow*
However when I call the newly added object to the array I get the first 6 objects work correctly but the newly added object functions like:
$PrinterPermissions[6] = gprt_PrinterA
$PrinterPermissions[6][0] = g
$PrinterPermissions[6][1] = p
$PrinterPermissions[6][2] = r
$PrinterPermissions[7] = ManageDocuments
$PrinterPermissions[8] = Allow
What I want is for the newly added item to function in the array as the first 6 items. So I can dynamically add to the array. What am I doing wrong.