Azure / Azure/azure-powershell

[Eng]: Example Analyzer considers example code beginning with empty line as no example

Open
#21,569 0 comments 0 reactions 0 assignees View on GitHub
Engineering Tracking
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

If there is an empty line after \```powershell, our example analyzer will consider this example is empty due to https://github.com/Azure/azure-powershell/blob/5071fdedc8b3ae13d6be8d351f32bec9e97f5604/tools/HelpGeneration/HelpGeneration.psm1#L210-L213

\#\#\# Example 1: Creates an AzureFrontDoor delivery rule within the specified rule set
\```powershell

$conditions = @(
New-AzFrontDoorCdnRuleClientPortConditionObject -Name ClientPort -ParameterOperator Equal -ParameterMatchValue 80,81
New-AzFrontDoorCdnRuleIsDeviceConditionObject -Name IsDevice -ParameterMatchValue Mobile
New-AzFrontDoorCdnRuleSslProtocolConditionObject -Name SslProtocol -ParameterMatchValue TLSv1.2
);


$actions = @(
New-AzFrontDoorCdnRuleRequestHeaderActionObject -Name ModifyRequestHeader -ParameterHeaderAction Append -ParameterHeaderName a1 -ParameterValue a1
New-AzFrontDoorCdnRuleResponseHeaderActionObject -Name ModifyResponseHeader -ParameterHeaderAction Append -ParameterHeaderName a1 -ParameterValue a1
New-AzFrontDoorCdnRuleUrlRedirectActionObject -Name UrlRedirect -ParameterRedirectType Moved -ParameterDestinationProtocol MatchRequest
);

New-AzFrontDoorCdnRule -ResourceGroupName testps-rg-da16jm -ProfileName fdp-v542q6 -RuleSetName ruleset001 -Name rule1 -Action $actions -Condition $conditions
\```

\```output
Name ResourceGroupName
---- -----------------
rule1 testps-rg-da16jm
\```

Creates an AzureFrontDoor delivery rule within the specified rule set

Contributor guide

Open the contributing guide

Research direction

Start in tools/HelpGeneration/HelpGeneration.psm1 at lines 210-213 and inspect how leading blank lines are handled when analyzing a PowerShell example. Reproduce the issue with the example in this report, then verify that the example is recognized as non-empty and its output remains processed correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.