Skip to content

Commit df4a2b7

Browse files
authored
Fix the issue that generate-help cannot find a name (#23526)
1 parent cfaa36b commit df4a2b7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/HelpGeneration/HelpGeneration.psm1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,15 @@ function Test-AzMarkdownHelp
9292
$Exceptions = Import-Csv "$SuppressedExceptionsPath\ValidateHelpIssues.csv"
9393
[String[]]$errors = @()
9494
$MarkdownFiles = Get-ChildItem -Path $HelpFolder -Filter "*.md"
95-
$ModuleName = ($MarkdownFiles | where { $_.Name -notlike "*-*" }).Name -replace ".md",""
95+
$HelpFolderPath = $HelpFolder.FullName.Replace("\", "/")
96+
if ($HelpFolderPath -match "/artifacts/")
97+
{
98+
$ModuleName = $HelpFolderPath.split('/artifacts/')[1].split('/')[1]
99+
}
100+
else
101+
{
102+
$ModuleName = "Az." + $HelpFolderPath.split('src/')[1].split('/')[0]
103+
}
96104
foreach ($file in $MarkdownFiles)
97105
{
98106
# Ignore the module page

0 commit comments

Comments
 (0)