Convert Output to HTML in PowerShell

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 to be displayed in the console (ex: FullName: C: \ Windows ...). But when I open Out.html, it has strange things like:

ClassId2e4f51ef21dd47e pageHeaderEntry pageFooterEntry autosizeInfo shapeInfo groupingEntry

What am I missing here?

+6
source share
3 answers

Use select-object instead of format-list .

+6
source
 cmd: powershell gci -path %windir% ^| ?{$_.LastWriteTime -gt (Get-Date -Year 2011 -Month 04 -Day 01)} ^| Format-List -property Fullname | more PS>gci -path %windir% | ?{$_.LastWriteTime -gt (Get-Date -Year 2011 -Month 04 -Day 01)} | Format-List -property Fullname | more 
0
source

Source: https://habr.com/ru/post/888093/


All Articles