|
15 | 15 | This function is dependent on jquery, the bootstrap framework and the jasny bootstrap add-on. |
16 | 16 |
|
17 | 17 | Author: Øyvind Kallstad @okallstad |
18 | | - Version: 1.0 |
| 18 | + Version: 1.1 |
19 | 19 | #> |
20 | 20 | [CmdletBinding()] |
21 | 21 | param( |
22 | 22 | # Name of module. Note! The module must be imported before running this function. |
23 | 23 | [Parameter(Mandatory = $true)] |
24 | 24 | [ValidateNotNullOrEmpty()] |
25 | | - [string]$ModuleName, |
| 25 | + [string] $ModuleName, |
26 | 26 |
|
27 | 27 | # Full path and filename to the generated html helpfile. |
28 | 28 | [Parameter(Mandatory = $true)] |
29 | | - [string]$Path |
| 29 | + [string] $Path, |
| 30 | + |
| 31 | + # Skip dependency check. |
| 32 | + [Parameter()] |
| 33 | + [switch] $SkipDependencyCheck = $false |
30 | 34 | ) |
31 | 35 |
|
32 | 36 | # jquery filename - remember to update if you update jquery to a newer version |
|
37 | 41 |
|
38 | 42 | try { |
39 | 43 | # 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 | + } |
45 | 51 | } |
| 52 | + if($missingDependency) { break } |
| 53 | + Write-Verbose 'Dependency check OK' |
46 | 54 | } |
47 | | - if($missingDependency) { break } |
48 | | - Write-Verbose 'Dependency check OK' |
49 | 55 |
|
50 | 56 | # add System.Web - used for html encoding |
51 | 57 | Add-Type -AssemblyName System.Web |
|
98 | 104 | "@ |
99 | 105 |
|
100 | 106 | # loop through the commands to build the menu structure |
| 107 | + $count = 0 |
101 | 108 | foreach($command in $moduleCommands) { |
| 109 | + $count++ |
| 110 | + Write-Progress -Activity "Creating HTML for $($command)" -PercentComplete ($count/$moduleCommands.count*100) |
102 | 111 | $html += @" |
103 | 112 | <!-- $($command) Menu --> |
104 | 113 | <li class="dropdown"> |
|
0 commit comments