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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:27:37+00:00 2026-06-07T06:27:37+00:00

I am trying to understand why, when I call the above function, I am

  • 0

I am trying to understand why, when I call the above function, I am getting hex 0D0A every 80th column on the output I am reading.

I have a powershell script, for testing that has two lines in it for brevity’s sake:

$xmlSpew = "<IISAppPoolConfig><DefaultWebSite><ApplicationPoolName>DefaultAppPool</ApplicationPoolName></DefaultWebSite><AuthN>Basic</AuthN></IISAppPoolConfig>"
Write-Output $xmlSpew

I am calling the script using the Process object with ProcessStartInfo as follows:

var psi = new ProcessStartInfo
{
    WorkingDirectory = Path.GetDirectoryName(FileToRun),
    FileName = FileToRun,
    Arguments = Arguments,
    UseShellExecute = false,
    CreateNoWindow = true,
    RedirectStandardError = true,
    RedirectStandardOutput = true,
};

var process = new Process
{
    StartInfo = psi,
    EnableRaisingEvents = true,
};

FileToRun value is:

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe

Arguments value is:

-File "C:\Program Files\MyTest\MyProgInputs\read.d\IISAppPoolConfig.ps1"

The script runs fine and I get back exit code 0, but I have this mysterious (to me) 0D0A newline every 80th char in standard out that I capture using:

var Stdout = new List<string>;

...

Stdout.Add(process.StandardOutput.ReadToEnd());

This is wreaking havoc on my XML efforts once I have standard out stored in a string var. I expected to get exactly what I write to the stdout in the ps1 script, not the extra newline.

What am I missing? I’ve looked for others with this issue, but I have not found an answer. Hopefully it is not me being search-challenged.

  • 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-07T06:27:40+00:00Added an answer on June 7, 2026 at 6:27 am

    Final and tested resolution for now (because I need to ship something), is to have output from powershell come from the Write-Host cmdlet instead of Write-Output. The process for obtaining stdout remained the same as in my original post. Hope this helps others. Thanks for all the inputs.

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

Sidebar

Related Questions

I have a function and I am trying to call that inside another function.
I am trying to understand how mmap works. User level call of mmap looks
I am trying understand ViewModels deeper and I have read many articles and blogs
I'm trying to understand the system call interface and implementation in the Linux kernel.
I have a question about the map function in Python. From what I understand,
Trying to understand what's the correct way of implementing OpenID authentication with Spring Security.
Trying to understand the Deezer API. When I visit: http://connect.deezer.com/oauth/auth.php?app_id=MY_APP_ID&redirect_uri=http://mydomain.me&perms=basic_access I end up at
Trying to understand PNG format. Consider this PNG Image: The Image is taken from
Trying to understand the options for will_paginate's paginate method: :page — REQUIRED, but defaults
Trying to understand Ruby a bit better, I ran into this code surfing the

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.