Newbie question

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Ronald Gans Ronald Gans 2 years, 1 month ago.

  • Author
    Posts
  • #20240
    Profile photo of Ronald Gans
    Ronald Gans
    Participant

    I'm learning PS. If I execute:

    Dir | Format-Table * | Out-Host performs as I expected. I get a big table with a lot of columns about files, which is what I expect.

    And if I use:

    Dir | Sort-Object Length | Select-Object Name, Length | ConvertTo-Html | Out-File report.htm

    I get a table in HTM format as expected also.

    BUT if I use:

    Dir | Format-Table * | ConvertTo-Html | Out-File report.htm

    I get a weird HTM file full of ClassIDs and seriously bad html table and none of the info I expected.

    Any idea why?

  • #20241
    Profile photo of Don Jones
    Don Jones
    Keymaster

    See "The Big Book of PowerShell Gotchas." Common question. Format commands can't be piped to many others.

  • #20244
    Profile photo of Ronald Gans
    Ronald Gans
    Participant

    THANKS!!!!

You must be logged in to reply to this topic.