title: Error in PowerShell script: Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'
body: <p>I am struggling with an error message which shows up whenever I run the script below.
  Could you please help me to identify and fix this error message?</p>
  <p>Error message:</p>
  <pre><code>Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'
  
      At line:1 char:1
      + $success + $failed |
      + ~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (op_Addition:String) [], RuntimeException
          + FullyQualifiedErrorId : MethodNotFound
  </code></pre>
  <hr />
  <p>Here is full script:</p>
  <pre><code>$Header = @&quot;
  &lt;style&gt;
  table {
    font-family: &quot;Trebuchet MS&quot;, Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }
  th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: green;
    color: white;
  }
  &lt;/style&gt;
  &quot;@
  
  $params = @{
      ComputerName  = Get-Content -Path 'C:\servers.txt'
      Count         =  1
      ErrorAction   = 'SilentlyContinue'
      ErrorVariable = 'errors'
  }
  
  $success = Test-Connection @params |
                 Select-Object @{n='Server';e={$_.address}},
                               IPv4Address,
                               @{n='Result';e={'Successful'}}
  
  $failed = $errors.exception.message |
                Where-Object {$_ -match &quot;computer '(.+?)'&quot;} |
                    Select-Object @{n='Server';e={$matches.1}},
                                  @{n='IPv4Address';e={&quot;N/A&quot;}},
                                  @{n='Result';e={'Failed'}}
  
      $success + $failed |
          ConvertTo-Html -Title &quot;Fragment&quot; -Head $Header |
              Set-Content -Path StatusReport.html -Encoding UTF8
  </code></pre>