title: PowerShell split string into two dimensional array
body: <p><strong>TL:DR</strong></p>
  
  <p>Using PowerShell I want to split a string of text first by the new line character (\n), store it into an array, then split those array entries with a comma into a two-dimensional array. I am having trouble accessing (or possibly creating) any information in the second dimension.</p>
  
  <p><strong>INFO:</strong></p>
  
  <p>I have the following string (stored as <code>$services</code>):</p>
  
  <pre><code>SUPER-PC,Microsoft Office ClickToRun Service,ClickToRunSvc,C:\Program Files\Microsoft Office 15\ClientX64\OfficeClickToRun.exe /service,Auto
  SUPER-PC,Adobe Acrobat Update Service,AdobeARMservice,C:\Program Files (x86)\Common Files\Adobe\ARM\1.0\armsvc.exe,Auto
  </code></pre>
  
  <p><strong>Desired result:</strong></p>
  
  <p>I want to split the string twice:</p>
  
  <ol>
  <li>Split on the new line (first dimension)</li>
  <li>Split on the commas within the line (second dimension)</li>
  </ol>
  
  <p>I want the end result of this to be a two dimensional array that I can reference. (<strong>Ex:</strong> <code>$services[0][0]</code> etc.)</p>
  
  <p><strong>Commands Used:</strong></p>
  
  <p>To accomplish the new line split I have been using the following command:</p>
  
  <pre><code>$services= $services -split "\n"
  </code></pre>
  
  <p>To access the split string in the new array structure I can do the following:</p>
  
  <pre><code>$services[0]
  </code></pre>
  
  <p>PowerShell displays only the first line of <code>$services</code></p>
  
  <p>Next I use: </p>
  
  <pre><code>$services[0] = $services[0] -split ','
  </code></pre>
  
  <p><strong>Problem:</strong> </p>
  
  <p>When I attempt to access the second dimension of the first array using <code>$services[0][0]</code> it displays <code>S</code> which is the first character of the character array ("SUPER-PC" being the start of the string), not the two-dimensional array I want to create.</p>
  
  <p>Where am I going wrong?</p>