Skip to content

Commit a4d5180

Browse files
committed
Added SkipDependencyCheck Parameter
1 parent 6780fec commit a4d5180

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

Invoke-CreateModuleHelpFile.ps1

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,22 @@
1515
This function is dependent on jquery, the bootstrap framework and the jasny bootstrap add-on.
1616
1717
Author: Øyvind Kallstad @okallstad
18-
Version: 1.0
18+
Version: 1.1
1919
#>
2020
[CmdletBinding()]
2121
param(
2222
# Name of module. Note! The module must be imported before running this function.
2323
[Parameter(Mandatory = $true)]
2424
[ValidateNotNullOrEmpty()]
25-
[string]$ModuleName,
25+
[string] $ModuleName,
2626

2727
# Full path and filename to the generated html helpfile.
2828
[Parameter(Mandatory = $true)]
29-
[string]$Path
29+
[string] $Path,
30+
31+
# Skip dependency check.
32+
[Parameter()]
33+
[switch] $SkipDependencyCheck = $false
3034
)
3135

3236
# jquery filename - remember to update if you update jquery to a newer version
@@ -37,15 +41,17 @@
3741

3842
try {
3943
# check dependencies
40-
$missingDependency = $false
41-
foreach($dependency in $dependencies) {
42-
if(-not(Test-Path -Path ".\$($dependency)")) {
43-
Write-Warning "Missing: $($dependency)"
44-
$missingDependency = $true
44+
if (-not($SkipDependencyCheck)) {
45+
$missingDependency = $false
46+
foreach($dependency in $dependencies) {
47+
if(-not(Test-Path -Path ".\$($dependency)")) {
48+
Write-Warning "Missing: $($dependency)"
49+
$missingDependency = $true
50+
}
4551
}
52+
if($missingDependency) { break }
53+
Write-Verbose 'Dependency check OK'
4654
}
47-
if($missingDependency) { break }
48-
Write-Verbose 'Dependency check OK'
4955

5056
# add System.Web - used for html encoding
5157
Add-Type -AssemblyName System.Web
@@ -98,7 +104,10 @@
98104
"@
99105

100106
# loop through the commands to build the menu structure
107+
$count = 0
101108
foreach($command in $moduleCommands) {
109+
$count++
110+
Write-Progress -Activity "Creating HTML for $($command)" -PercentComplete ($count/$moduleCommands.count*100)
102111
$html += @"
103112
<!-- $($command) Menu -->
104113
<li class="dropdown">

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ To read the built-in help:
1515

1616
```powershell
1717
Get-Help Invoke-CreateModuleHelpFile
18-
```
18+
```
19+
20+
TODO:
21+
- Create fallback CSS for use without Bootstrap and jQuery

0 commit comments

Comments
 (0)