Screen output - Write-Information? Write-Verbose?

Welcome Forums General PowerShell Q&A Screen output - Write-Information? Write-Verbose?

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
6 months, 3 weeks ago.

  • Author
    Posts
  • #99375

    Participant
    Points: 75
    Rank: Member

    Hey everyone –

    I've got a question about screen output. I've got a module that I am working on that currently has a lot of verbose output. The question that I've got is — *some* of the verbose output is considered more important than others, as the screen output is a decent amount.

    When the function runs into potential problems, I use Write-Error / Write-Warning, but the rest is Write-Verbose. I am trying to figure out a way to draw attention to the more important verbose information. The easy answer would be to change the foreground color of these more important messages (I have no interest in killing puppies using Write-Host).

    Would changing the verbose output color for these certain messages be a good idea? Or is that something typically frowned upon? I was also looking at Write-Information – but I see that outputs to the screen in white – and I believe you lose some of the built in functionality you get with Write-Verbose.

    How would something like this typically be handled?

    Thanks
    Steve

  • #99384

    Participant
    Points: 155
    Helping Hand
    Rank: Participant
  • #99387

    Participant
    Points: 176
    Helping Hand
    Rank: Participant

    Depending on their content, you might consider utilising Write-Debug for the "less important" verbose messages.

    It's certainly possible you're overdoing it with the output. Is it all really necessary? Does it provide useful information? Are you duplicating information? Are you being overly verbose when you could be more succinct?

  • #99709

    Participant
    Points: 75
    Rank: Member

    Thank you for the responses. I agree – I am probably over doing the verbose output a little bit. I may be able to get what I want out of Write-Progress. I am going to dig into that a little to learn about it.

    Also – thank you for linking the style guide. I am always looking for reference material like this.

    Thanks
    Steve

The topic ‘Screen output - Write-Information? Write-Verbose?’ is closed to new replies.