Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9252743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:01:38+00:00 2026-06-18T11:01:38+00:00

I am fairly new to powershell, but when I try to run this portion

  • 0

I am fairly new to powershell, but when I try to run this portion of the code, it works sometimes, but I usually get an error message:

"Method invocation failed because [System.Management.Automation.PSObject] doesn't contain a method named 'op_Addition'."

It seems to fail when I add $in + $o, and it has worked in the past. I haven’t changed anything for it to stop working though. I am trying to append to a csv, and I have tried Export-CSV -append, however that does not work for me. Any ideas on what might be wrong with this code?

    $in = Import-Csv $csv

    $obj = New-Object PSObject
    $obj | Add-Member NoteProperty Column1 "$c1"
    $obj | Add-Member NoteProperty Column2 "$c2"
    $obj | Add-Member NoteProperty Column3 "$c3"

    $in + $obj | Export-Csv -Encoding ASCII -NoTypeInformation $csv
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:01:40+00:00Added an answer on June 18, 2026 at 11:01 am

    That probably worked before when $in is an array. However if you read in a CSV with just a single element it will fail. You can do this instead in PowerShell 3.0 (you don’t need to even read in $in):

    $obj | Export-Csv $csv -Encoding ASCII -NoTypeInformation -Append
    

    The -Append parameter on Export-Csv is new in PowerShell 3.0. If you don’t have 3.0 then modify this line:

    $in = @(Import-Csv $csv)
    

    Then it should work. That makes sure that $in is always an array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly new to PowerShell, but have a strong C# background. The task I'm
I'm fairly new to Powershell but I've got a rather interesting problem. I have
still fairly new to matlab, picked up this data analysis code from someone and
Sorry if this is too easy of a question, but I'm fairly new to
Fairly new to asp.net Mvc and jquery. Have the following code working fine, but
Fairly new to programming. I just can't wrap my head around how to get
I am fairly new to php and mysql but I have created a small
Fairly new to jquery so I might be making a simple mistake but I
Fairly new to socket programming, but I've been assigned with a whopper of project.
im fairly new to android development, but i'm having some trouble trying to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.