Severity: Info
Location: setup/publish.ps1:26 (docstring) vs :37 (param)
Code:
<#
...
.EXAMPLE
PS> .\publish.ps1 -fm "net10.0" -version "3.8"
...
#>
param(
[string]$Tfm = "net10.0-windows",
[ValidatePattern("^\d+\.\d+$")]
[string]$Version = "8.1"
)
Explanation:
The .EXAMPLE section of the comment-based help uses -fm "net10.0", but the real parameter is -Tfm. PowerShell's prefix-matching will accept -fm as an unambiguous shortening of -Tfm only as long as no other parameter starts with fm — today that is the case, so the example happens to work, but a reader copy-pasting from Get-Help .\publish.ps1 -Examples will be confused if prefix matching ever becomes ambiguous or is disabled.
Suggested fix:
Update the docstring to match the parameter name:
.EXAMPLE
PS> .\publish.ps1 -Tfm "net10.0" -Version "3.8"
Severity: Info
Location:
setup/publish.ps1:26(docstring) vs:37(param)Code:
Explanation:
The
.EXAMPLEsection of the comment-based help uses-fm "net10.0", but the real parameter is-Tfm. PowerShell's prefix-matching will accept-fmas an unambiguous shortening of-Tfmonly as long as no other parameter starts withfm— today that is the case, so the example happens to work, but a reader copy-pasting fromGet-Help .\publish.ps1 -Exampleswill be confused if prefix matching ever becomes ambiguous or is disabled.Suggested fix:
Update the docstring to match the parameter name:
.EXAMPLE PS> .\publish.ps1 -Tfm "net10.0" -Version "3.8"