Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the UX metadata issue caused by missing Categories attribute #1312

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion powershell/resources/assets/generate-portal-ux.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $moduleInfo = Get-Module -Name $moduleName
$parameterSetsInfo = Get-Module -Name "$moduleName.private"

$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet")
$skipParameterList = @("Confirm", "Verbose", "Debug", "ErrorAction", "WarningAction", "InformationAction", "ErrorVariable", "WarningVariable", "InformationVariable", "OutVariable", "OutBuffer", "PipelineVariable", "WhatIf")

function Test-FunctionSupported()
{
Expand All @@ -57,7 +58,15 @@ function Test-FunctionSupported()
$parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName]
foreach ($parameterInfo in $parameterSetInfo.Parameters.Values)
{
if ($skipParameterList -contains $parameterInfo.Name)
{
continue
}
$category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories
if ($category.length -eq 0)
{
return $false
}
$invalideCategory = @('Query', 'Body')
if ($invalideCategory -contains $category)
{
Expand Down Expand Up @@ -361,4 +370,4 @@ foreach ($resourceType in $resourceTypes.Keys)
}
$resourceTypeInfo.Remove("provider")
$resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json"
}
}
Loading