Newbie question

This topic contains 2 replies, has 2 voices, and was last updated by  Ronald Gans 3 years, 7 months ago.

  • Author
  • #20240

    Ronald Gans

    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

    Don Jones

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

  • #20244

    Ronald Gans


You must be logged in to reply to this topic.