Automatic PowerShell Function Documenting
MIT License
This Script can be used to document all Custom PowerShell Functions inside of a Script or a Script Directory. I just created this script and I am testing it to multiple use cases. This whole project could be a PowerShell module in the future.
For now I just want to have it sitting here and enhance it.
An example documentation generated for this script can be found inside the Output
folder.
See the New-ScriptDocumentation
function below for how to use this Script. You Basically have two options:
New-ScriptDocumentation -Folder <string> -FileTypes <string[]> [-Output <string>] [-Assemblies <string[]>] [-Destination <string>] [<CommonParameters>]
New-ScriptDocumentation -File <string> [-Assemblies <string[]>] [-Destination <string>] [<CommonParameters>]
Script that automatically creates Markdown Documentations for all functions inside a script file or inside of multiple scripts in a folder.
Script that automatically creates Markdown Documentations for all functions inside a script file or inside of multiple scripts in a folder. This works by parsing the script files and just exporting all functions. The temporary function file can then be dot-sourced to make all functions available to the console. In the console this script can use Get-Help and Get-Command to get all details to each function.
New-ScriptDocumentation -File 'C:\Scripts\ProjectOne\Script.ps1'
Creates a Markdown Documentation for all functions inside one Scriptfile.
New-ScriptDocumentation -File 'C:\Scripts\ProjectOne\Script.ps1' -Destination 'C:\Temp\'
Creates a Markdown Documentation for all functions inside one Scriptfile. The documentation will be saved inside C:\Temp.
New-ScriptDocumentation -Folder 'C:\Scripts\ProjectOne' -FileTypes '.ps1','.psm' -Destination 'C:\Temp\'
Creates a Markdown Documentation for each script files inside of a folder. The documentations will be saved inside C:\Temp.
New-ScriptDocumentation -Folder 'C:\Scripts\ProjectOne' -FileTypes '.ps1','.psm' -Output 'Single' -Assemblies 'System.Windows.Forms', 'System.Drawing' -Destination 'C:\Temp\'
Creates one Markdown Documentation for all script files inside of a folder. The Script uses two Assemblies that are loaded while processing each script file. The single documentation will be saved inside C:\Temp.
-Folder
The path to the folder containing multiple script files that needs to be documented.
-FileTypes
An array of extensions to select which files should be documented recursively.
-Output
Single or Multi - Defines whether only one documentation should be created or one per script file.
-Destination
Defines where the documentation files are beeing saved.
-File
The path to the script file that needs to be documented.
-Assemblies
An array of assemblies needed by the script