Skip to content

Commit c109109

Browse files
authored
Merge pull request Azure#4539 from cormacpayne/demand-fix
Fix failure in on-demand build caused by HelpGeneration script
2 parents 0222244 + e1c8541 commit c109109

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

setup/azurecmdfiles.wxi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,9 +1556,6 @@
15561556
<Component Id="cmpC67F14F377421F1BCD74EC5A579D43CB" Guid="*">
15571557
<File Id="filE9553CEC1D67AB3D4B77759239D60B18" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.IotHub\Microsoft.Azure.Commands.IotHub.dll-Help.xml" />
15581558
</Component>
1559-
<Component Id="cmpD844DA64698210481D550B5CD8799D26" Guid="*">
1560-
<File Id="filA23D9B350E9B87D17B90B2181AE71E4B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.IotHub\Microsoft.Azure.Commands.IotHub.format.ps1xml" />
1561-
</Component>
15621559
<Component Id="cmp31610C192ED2776279BBDA3D9905552E" Guid="*">
15631560
<File Id="filB571C170B96736E7EE17BBF869A203A8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.IotHub\Microsoft.Azure.Commands.ResourceManager.Common.dll" />
15641561
</Component>
@@ -5842,7 +5839,6 @@
58425839
<ComponentRef Id="cmp9DFE8C2688F7DF1A3DFF20EFA59BF3B5" />
58435840
<ComponentRef Id="cmpE29D513714759F365A7C0A2A7F2B5DC6" />
58445841
<ComponentRef Id="cmpC67F14F377421F1BCD74EC5A579D43CB" />
5845-
<ComponentRef Id="cmpD844DA64698210481D550B5CD8799D26" />
58465842
<ComponentRef Id="cmp31610C192ED2776279BBDA3D9905552E" />
58475843
<ComponentRef Id="cmpB0A6B8E083FEAEC29D41F54189DC6605" />
58485844
<ComponentRef Id="cmpB2620706D83DB49D3434BB39A5495055" />

tools/HelpGeneration/HelpGeneration.psm1

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ function Validate-MarkdownHelp
118118
if ($content[$idx+1] -notcontains "## SYNTAX")
119119
{
120120
$idx++
121+
if ($idx -ge $content.Length)
122+
{
123+
Write-Error "Could not find SYNTAX header in file $($file.Name)"
124+
return
125+
}
121126
}
122127
elseif ($content[$idx] -contains "{{Fill in the Synopsis}}")
123128
{
@@ -147,6 +152,11 @@ function Validate-MarkdownHelp
147152
if ($content[$idx+1] -notcontains "## EXAMPLES")
148153
{
149154
$idx++
155+
if ($idx -ge $content.Length)
156+
{
157+
Write-Error "Could not find EXAMPLES header in file $($file.Name)"
158+
return
159+
}
150160
}
151161
elseif ($content[$idx] -contains "{{Fill in the Description}}")
152162
{
@@ -167,9 +177,14 @@ function Validate-MarkdownHelp
167177
"## EXAMPLES"
168178
{
169179
# Move the index to the start of the PowerShell code
170-
while ($content[$idx] -notcontains "``````")
180+
while ($content[$idx] -notcontains "``````" -and $content[$idx] -notcontains "``````powershell")
171181
{
172182
$idx++
183+
if ($idx -ge $content.Length)
184+
{
185+
Write-Error "Could not find start of PowerShell example in file $($file.Name)"
186+
return
187+
}
173188
}
174189

175190
# Check for the platyPS example template

0 commit comments

Comments
 (0)