Skip to content

Commit 3ccd117

Browse files
committed
ci: a command without parameters serves no parameter help
Get-IntuneAnalyzerRulePath takes nothing, and the help gate on Linux read its empty parameter block as MAML not being served.
1 parent b7fdba1 commit 3ccd117

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/quality-gates.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ jobs:
299299
# falls back to reflected syntax with no description and no examples.
300300
if (-not $help.Description) { $failed += "$command : no description" ; continue }
301301
if (@($help.Examples.Example).Count -lt 3) { $failed += "$command : fewer than 3 examples" ; continue }
302-
if (-not $help.parameters.parameter) { $failed += "$command : no parameter help" ; continue }
302+
# A command with no parameters of its own has no parameter help to serve
303+
$common = [System.Management.Automation.Cmdlet]::CommonParameters
304+
$own = @((Get-Command $command).Parameters.Keys | Where-Object { $_ -notin $common })
305+
if ($own -and -not $help.parameters.parameter) { $failed += "$command : no parameter help" ; continue }
303306
304307
Write-Host ("{0,-30} {1} examples, {2} parameters" -f
305308
$command, @($help.Examples.Example).Count, @($help.parameters.parameter).Count)

0 commit comments

Comments
 (0)