title: I keep getting "Unable to index into an object of type System.String." when I change the value of my array in PowerShell
body: <p>I am trying to create a PowerShell script that creates folders (nested and multiple). I managed to get the nested folders to work, and I am pretty new to this, but I cant seem to  get the multiple folders to work. I basically want to make a string array with each item being a user inputted string. I tried everything but it just doesn't seem to work, any help would be greatly appreciated, heres my code</p>
  
  <pre><code>echo "Folder Creator for FS2019 by Skaytacium, enter the values for unlimited nested folders! Remember though, 260 characters is the max nesting limit!"
  
  $count = Read-Host -Prompt 'How many folders? Value'
  $count = [int16]$count
  
  $sub = Read-Host -Prompt 'Do you wanna nest? 2/1'
  
  $namestring = "./"
  $storay
  
  [string]$array = "0", "0", "0"
  
  $arac = 0
  $arac = [int16]$arac
  
  
  if ($sub -eq "2") {
      echo "The specified folders will be nested"
  
      while ($count -gt 0) {
  
          $namestring = $namestring + (Read-Host -Prompt 'Name') + "/"
          $count--
          echo $namestring
  
          if ($count -eq 0) {
              md $namestring
          }
      }
  }
  
  elseif ($sub -eq "1") {
      echo "The specified folders will be consecutive (in the same dir)"
  
      while ($count -gt 0){
          $storay = Read-Host "Name"
          $array[1] = @("please help")
          echo $array
          $arac++
          $count--
      }
  }
  
  Pause
  </code></pre>
  
  <p>Thanks,
  Sid</p>