title: Error: The string is missing the terminator:
body: <pre><code>#Write-Host "Hello, World!"
  Import-Module ActiveDirectory
  
  $str = $args
  
  $str1 = $str.Replace(""", "")
  $array1 = $str1.split(",")
  $array_length = $array1.Length
  $user_id = $array1[0]
  $unremoved_Ad = @($array_length - 1)
  
  for($i = 1; $i -lt $array_length; $i++) {
      Write-Host "$($user_id) - $($array1[$i])"
  
      try {
          #Remove-ADGroupMember -Identity $array[$i] -Member $user_id -Confirm:$false
      } catch {
          $unremoved_Ad = $unremoved_Ad + $array[$i]
  
          if($i -ne ($array_length - 1)) {
              $unremoved_Ad = $unremoved_Ad
          }
      }
  }
  Write-Host $unremoved_Ad
  </code></pre>
  
  <p>Hi I am new to Powershell and I am trying to do just a basic thing above. However, I get an error: <code>The string is missing terminator:</code> .</p>
  
  <p>Updating the code. Looks like there is a major goof up in <code>Write-Host</code> immediately after <code>for</code> loop.</p>
  
  <p>Please help. Thanks in advance.</p>