0

Im a noob with Powershell, I need help converting a specific man page into an html document

about_script

my code is: get-help about_scripts | convertto-html > scr.html

it creates an html page but it doesn't have most of the data in just the first couple of lines and a number showing how long it is.

can someone help by telling me what I'm doing wrong?

2 Answers2

1

Why reinvent the wheel? PowerShell has all the documentation online already..

about_Scripts

You can find the help files for all the cmdlets. For 3rd party modules, documentation is usually included or available online.

All PowerShell Core modules

Frode F.
  • 52,376
  • 9
  • 98
  • 114
  • But for someone writing 3rd party scripts, cmdlet, modules, &c, this doesn't answer the question asked: How to convert the `Get-Help` output into HTML. – brianary Apr 11 '21 at 20:38
  • 1
    The point is that you shouldn't convert existing third-party help like `about_Scripts` above to HTML - that's the job of the developer. For the developers, take a look at [platyPS](https://github.com/PowerShell/platyPS) which can create markdown that you in turn can publish or convert to HTML. – Frode F. Apr 14 '21 at 19:17
0
ConvertTo-HTML -Body "<p>$(Get-Help about_scripts)</p>" | Out-File aboutscripts.html

Start Here

E.V.I.L.
  • 2,120
  • 13
  • 14