title: Output membership of certain Window local groups
body: <p>Working on a simple script to loop through a bunch of machines through a 3rd party system and output the machine, group, and the user to a PS object.</p>
  <p>Have the script outputting the correct groups/users. However when a group has more than one user, then it renders it on the same line, instead of a new line. Just looking for insight on how to properly format the output so each result is on it's own line.</p>
  <pre><code>  $params = $args
  $Target = $args[0]
  $PrivUser = &quot;$($params[1])\$($params[2])&quot;
  $PrivPwd = ConvertTo-SecureString -String $params[3] -AsPlainText -Force
  $cred = [pscredential]::new($PrivUser,$PrivPwd)
  $Groups =  @('Administrators','Power Users')
  $results = @()
  try {
      Invoke-Command -ComputerName $Target -Credential $cred -HideComputerName -ScriptBlock {
          $lgs =  Get-LocalGroup -Name $Groups
          Foreach ($lg in $lgs) {
              $ms = Get-LocalGroupMember -Name $lg
              #write-host $ms.Name
              $output = New-Object PSObject -Property @{
                  Machine = $env:COMPUTERNAME
                  Group = &quot;$lg&quot;
                  Username=$ms
              }
              $results += $output
          }
          return $results 
          
      }
   } catch {
      throw &quot;Unable to connect to target: $($args[0]) `n$_&quot;
  }
  </code></pre>
  <p>results:</p>
  <pre><code>Username                                                                   Group          Machine   
  --------                                                                   -----          -------   
  {BLT\clepley, BLT\clepley_admin, BLT\Domain Admins, BLT\svr.blt.div.ss...} Administrators BLT-SS-WEB
  BLT\clepley_admin                                                          Power Users    BLT-SS-WEB
  </code></pre>