From a5bb7defc1f0fde6f33d0e6c7ce767a59803b67a Mon Sep 17 00:00:00 2001 From: Yunchi Wang <54880216+wyunchi-ms@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:47:58 +0800 Subject: [PATCH 1/2] Fix the UX metadata issue caused by missing Categories attribute --- powershell/resources/assets/generate-portal-ux.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/powershell/resources/assets/generate-portal-ux.ps1 b/powershell/resources/assets/generate-portal-ux.ps1 index 2ed86b9cd7..c2c13759b9 100644 --- a/powershell/resources/assets/generate-portal-ux.ps1 +++ b/powershell/resources/assets/generate-portal-ux.ps1 @@ -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() { @@ -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) { From 1f11b803c02ee15ca6f4f10b3e70595ed6428de0 Mon Sep 17 00:00:00 2001 From: Yunchi Wang <54880216+wyunchi-ms@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:51:50 +0800 Subject: [PATCH 2/2] Update generate-portal-ux.ps1 --- powershell/resources/assets/generate-portal-ux.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powershell/resources/assets/generate-portal-ux.ps1 b/powershell/resources/assets/generate-portal-ux.ps1 index c2c13759b9..8539ac3786 100644 --- a/powershell/resources/assets/generate-portal-ux.ps1 +++ b/powershell/resources/assets/generate-portal-ux.ps1 @@ -32,7 +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") +$skipParameterList = @("Confirm", "Verbose", "Debug", "ErrorAction", "WarningAction", "InformationAction", "ErrorVariable", "WarningVariable", "InformationVariable", "OutVariable", "OutBuffer", "PipelineVariable", "WhatIf") function Test-FunctionSupported() { @@ -370,4 +370,4 @@ foreach ($resourceType in $resourceTypes.Keys) } $resourceTypeInfo.Remove("provider") $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" -} \ No newline at end of file +}