Code Monkey home page Code Monkey logo

psdoc's Introduction

psDoc is a Powershell Help Document generator.


Using psDoc

To generate documentation off of your module, simply import your module

Import-Module MySpecialModule

And generate the documentation

.\psDoc.ps1 -moduleName MySpecialModule

License

Microsoft Public License (Ms-PL)

psdoc's People

Contributors

alatas avatar andreasostlund avatar antonziminsaritasa avatar cboehme avatar chaseflorell avatar dannixon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psdoc's Issues

doesn't work

when I run .\psDoc.ps1 -ModuleName MyModule I get an error:

out-file : Could not find a part of the path 'C:\Users\me\Downloads\psDoc-master\psDoc-master\src\help\index.html'.
At C:\Users\me\Downloads\psDoc-master\psDoc-master\src\psDoc.ps1:54 char:1
+ Invoke-Expression $template > "$outputDir\$fileName"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], DirectoryNotFoundException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

bummer

psdoc doesn't work correctly if module name cannot be resolved

ie. there is no check to make sure that the module is installed on the system before psdoc is run.
and
if a wildcard is entered at the command line (or 2 modules with the same name are resolved by psmodulepath), all of the commands will be merged into the one output file.

this function will resolve both cases:

function Check-IfModuleExists($modName){
if((Get-Module -ListAvailable -Name $modName).Count -eq 1) {return $true}
else {return $false}
}

happy to send though a pull request with the changes...

Cheers,
Steve R.

Syntax block is not generated in HTML sometimes

Test1 module:

function Invoke-TestCmdlet
{
    param
    (
        [Parameter(Mandatory = $true, HelpMessage = 'Only test.')]
        [string] $Path
    )
}

.\psDoc.ps1 Test1 -template .\out-html-template.ps1 -fileName Test1.html
http://screencast.com/t/tZxmSQ1FRiT

.\psDoc.ps1 Test1 -template .\out-markdown-template.ps1 -fileName Test1.md
http://screencast.com/t/6Wi2v7V0kR

It happens, because the block is ignored in out-html-template.ps1:

if (!($_.syntax | Out-String ).Trim().Contains('syntaxItem')) {

However, the Markdown implementation works fine.

Add comment from scripts header

Hi,

It would be useful to add <# #> block at start of scripts. Maybe filenames could be added to the list of functions.

Regard

License

What's the license for this project?

Needed to create help directory to succeed

Excellent piece of work sir!

Stalled on this, guessed to create the help directory, reran and it worked.

out-file : Could not find a part of the path 'C:\Users\dfinke\Downloads\psDoc-master\src\help\index.html'.
At C:\Users\dfinke\Downloads\psDoc-master\src\psDoc.ps1:54 char:1
+ Invoke-Expression $template > "$outputDir\$fileName"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], DirectoryNotFoundException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

Multi lines examples

Hi,

Is there a way to deal with mulitples lines examples ?

For example, a header like this :

	<# 
	.SYNOPSIS
		Do Something
	.DESCRIPTION
		Do Something
	.PARAMETER Arg1
		Arg1
	.PARAMETER Arg2
		Arg2
	.PARAMETER Arg3
		Arg3
	.INPUTS
	.OUTPUTS
		Renvoit la liste de la ou des archive(s) générée(s)
	.EXAMPLE
		$var = 'Test'
		Do-Something -Arg1 $var
		Invoke the Do-Something cmdlet with the $var variable
	.NOTES
	.LINK
	#>

Looks like this :
image

When I would like it to look like this :
image

Regards,

Module with 1 cmdlet is not processed correctly

Exception is thrown in Update-Progress function:

Exception: Attempted to divide by zero. --> Attempted to divide by zero.

It happens, because $totalCommands is not defined.

$totalCommands = $commandsHelp.Count

Simple fix:

$totalCommands = $commandsHelp.Count
if (!$totalCommands)
{
    $totalCommands = 1
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.