Re: Colorize Get-Childitem Output



Grzegorz Niemirowski wrote:
/\/\o\/\/ <no@xxxxxxxx> napisał(a):

Yep,
this one will work, and as it does not use Write-Host, you can still redirect the output.

[CUT]

Very nice but the header is also colored. It looks like it's part of the first item. E.g. if the first file is .msh then "Directory: FileSystem..." is printed in red, not just the file itself.


I did notice that, that's the handling of the Object's by MSH,
as we use the default formating, as the header get's created for the first Object.


I did not know how to prevent that.

an other way would be to use processblocks in the function and do all the formatting yourself.(what will give you text to output also.)but you loose the objects.

So, I did choose to live with it.

another "bug" thats in it that I get 2 blank lines extra when I pipeline the output (ll | out-string), I don't know where they come from.


gr /\/\o\/\/ .



Relevant Pages

  • Re: sessions and redirecting in opera
    ... All the more reason why a header redirect should be ... Opera get's the redirect, but still has the page with the same ... exit(); // exit doesn't really make a difference for Opera ...
    (comp.lang.php)
  • Re: cant redirect to Excel
    ... I want to do is redirect to Excel in the case of the External user. ... Cannot modify header information - headers already sent by ... I think it is because it has to get the output first from the string ...
    (comp.lang.php)
  • Re: sessions and redirecting in opera
    ... All the more reason why a header redirect should be accompanied by ... Opera get's the redirect, but still has the page with the same ... exit(); // exit doesn't really make a difference for Opera ...
    (comp.lang.php)
  • Re: sessions and redirecting in opera
    ... Or could it perhaps be that Opera indeed thinks that it ... that redirected to the login page in the first place. ... All the more reason why a header redirect should be accompanied by ...
    (comp.lang.php)
  • Re: [PHP] Any way to use header() or another function to force user to "top level"
    ... to is loading within the <div> tags and at the top level of the ... causing the browser to load /some_url as if accessed directly. ... Once I make the call to header(), I no longer care about any state ... header/location redirect method. ...
    (php.general)