Run all the tests:
Invoke-Pester .\test\
To use the code coverage assessment use -CodeCoverage
:
$res = Invoke-Pester .\test\ -CodeCoverage ..\PowerGRR.psm1 -PassThru
The result can be read in the following manner:
PS> $res.TotalCount
11
PS> $res.FailedCount
0
PS> $res.PassedCount
11
Invoke-ScriptAnalyzer -Path .\PowerGRR\
Create new module manifest
New-ModuleManifest -Path .\PowerGRR.psd1 -RootModule PowerGRR.psm1 -Author "Swisscom (Schweiz) AG" -CompanyName 'Swisscom (Schweiz) AG' -ModuleVersion '0.1.0'
Build the markdown help with the following commands for a new documentation or for a new cmdlet in later stages.
- Import module
Import-Module .\PowerGRR.psd1 -Force
- Create new markdown help for module...
New-MarkdownHelp -Module PowerGRR -OutputFolder .\docs\ -WithModulePage -Force -HelpVersion "1.0.0.0"
- or create a markdown file for a specific cmdlet. When doing this it's possible to add the online URL to the help. This allows using "-Online" with the help command to display the online help.
New-MarkdownHelp -Command Get-GRRFlowInfo -OutputFolder .\docs\ -OnlineVersionUrl "https://github.com/swisscom/PowerGRR/blob/master/docs/Get-GRRFlowInfo.md"
Important: After creating a new help file for one specific command it must be added manually to the PowerGRR.md in /docs.
To update the markdown use the following commands.
Import-Module .\PowerGRR.psd1 -Force
Update-MarkdownHelp .\docs\
Use the following command to create the PowerShell external help file (use -force
to
update an existing external help file).
New-ExternalHelp -Path .\docs\ -OutputPath en-us\ -Force
Use the following ctags configuration for PowerShell. Run the command within the PowerGRR root directory.
ctags.cnf (variables disabled through the regex)
--langdef=powershell
--langmap=powershell:.psm1.ps1
--regex-powershell=/function\s+(script:)?([a-zA-Z\-]+)/\2/m, method/i
--exclude=test
Use the folloging ctags command to generate the PowerShell tags.
ctags -R --languages=powershell
Use the following ctags configuration for Pester. Run the command within the Pester test directory.
ctags -R --langdef=pester --langmap=pester:.ps1 --regex-pester="/describe\s+'(.*)'/\1/m, method/i"