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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:48:44+00:00 2026-05-14T18:48:44+00:00

(Sorry for strange title, haven’t come up with anything better..) Background I use nunit-console

  • 0

(Sorry for strange title, haven’t come up with anything better..)

Background

I use nunit-console to test my assemblies. It is called like this (simplified):

function Test-ByNunit {
    param($assembly, $tempFile = 'c:\temp\nunit.xml')
    & <path-to-nunit-console> $assembly /nologo /xml:$tempFile @othparam 
}
Test-ByNunit c:\temp\myAssembly.dll

I have no problem with this, it works fine.

Problem

nunit-console should output its messages as so far. That means – if not captured, it should send them to screen, otherwise it could be stored in file (Test-ByNunit $dll | set-content path)

I’d like to return somehow information about each test-case that was run (the info is stored in the /xml file) in form of array of PSObject objects.

Question

Do you have any tip how to return the info and still leave nunit output its messages?

If I simply write it to output, the function will return array of strings (output from nunit-console) and array of my objects. Then redirection to output file will store my objects as well, but I’d like just display them in console window.

The only possibility that could work is to use [ref], but I’d like to avoid it.

(this is not only about nunit-console, but of course it is general question)

  • 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-05-14T18:48:44+00:00Added an answer on May 14, 2026 at 6:48 pm

    If I got the task right then Out-Host should help:

    function Get-WithOutHost {
        # external output is redirected to the host
        cmd /c dir | Out-Host
        # normal output to be reused later
        Get-Process
    }
    
    # call    
    $result = Get-WithOutHost
    
    # now $result holds the data to use, external output is on the screen
    

    EDIT: of course this is not enough if external output should be reused, too, not just shown

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

Sidebar

Related Questions

Sorry for the strange title: because I don't know what this effect is called
Sorry about the strange title. I really have no idea how to express it
Sorry about the strange title, but I am having a small issue if the
Sorry for the strange title, I'm not really sure how to classify this issue.
sorry for the cryptic question title. I'm having a strange problem and i have
Sorry for the ambiguous title, but this is a strange issue. I'm using the
Sorry for the, strange title, but I couldnt quite get it across. Basically what
Sorry I couldn't really describe my problem much better in the title. I am
Sorry for the strange title. Here is my situation. I have a table of
sorry for the strange title. I have a quite large website written in pure

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.