I am learning PowerShell. During my experiments I used the following command:
PS C:\Windows\system32> gci -path C:\windows\ | Where-Object{$_.LastWriteTime -
gt "01-04-2011"} | Format-List -property Fullname | ConvertTo-Html | out-file E:
\PowerShell\Out.html
I expected the output like the one displayed in the console (like:FullName:C:\Windows...). But when I open the Out.html it has some strange things like:
ClassId2e4f51ef21dd47e pageHeaderEntry pageFooterEntry autosizeInfo shapeInfo groupingEntry
What am I missing here?
The ConvertTo-Html cmdlet converts . NET objects into HTML that can be displayed in a Web browser. You can use this cmdlet to display the output of a command in a Web page.
Using Format-Table for Tabular Output. If you use the Format-Table cmdlet with no property names specified to format the output of the Get-Process command, you get exactly the same output as you do without a Format cmdlet. By default, PowerShell displays Process objects in a tabular format.
Get-Content cmdlet is used to read content of a html file.
Use select-object
in place of format-list
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With