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 8230355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:06:19+00:00 2026-06-07T17:06:19+00:00

Looked for this but cannot find a resolution. By extra output, I mean the

  • 0

Looked for this but cannot find a resolution. By “extra” output, I mean the extra text that the Write-Output emits after your error message text. i.e.:

write-error -Message "test"

produces:

write-error -Message "test" : test
+ CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException

I would like to only see the text “test”, and retrieve it from stderr via a Process object that runs the PS script.

I know a complicated regex (to catch ALL the potential chars that could appear in the category, etc.) could be developed, but I want to avoid that. Don’t forget that Write-Error also injects a newline char at every 80th char position due to console, so that would have to be factored in as well.

Is there a way to tell Powershell (2.0) to not be so wordy when writing to stderr and write only the message part?

  • 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-07T17:06:21+00:00Added an answer on June 7, 2026 at 5:06 pm

    I think isn’t possible limit the output of an error but you can workaround like this:

    $Host.UI.WriteErrorLine("My custom error")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked around but cannot find anything that answered this particular question related
I've looked for a solution to this but cannot find anything that works. Note:
I have looked everywhere for the answer to this question, but cannot find anything
I've looked through the recent questions on this, but I cannot find a solution
I have looked already and cannot find this but does anyone know of an
I have looked through the answers in this forum but cannot seem to find
OK, I looked a lot for this on the web but cannot find an
I have looked on SO but cannot find an answer that works for me,
I've looked everywhere but cannot find an answer. How can I check that if
This looked like a very simple question but I couldn't find the answer. How

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.