Skip to content

Commit c6f40b7

Browse files
Migrate SelfHelp from generation to main (#24627)
* Move SelfHelp to main * Update ChangeLog.md --------- Co-authored-by: NanxiangLiu <33285578+Nickcandy@users.noreply.github.com>
1 parent 15bc112 commit c6f40b7

File tree

413 files changed

+31225
-4801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

413 files changed

+31225
-4801
lines changed

src/SelfHelp/SelfHelp.Autorest/Az.SelfHelp.format.ps1xml

Lines changed: 629 additions & 77 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,24 @@
1-
#
2-
# Module manifest for module 'Az.SelfHelp'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 11/10/2023
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.SelfHelp.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.1.1'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = '2705ffd2-39d8-491f-b0c6-14fca2dc3727'
22-
23-
# Author of this module
24-
Author = 'Microsoft Corporation'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft Corporation'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Microsoft Corporation. All rights reserved.'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Microsoft Azure PowerShell: SelfHelp cmdlets'
34-
35-
# Minimum version of the PowerShell engine required by this module
36-
PowerShellVersion = '5.1'
37-
38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
DotNetFrameworkVersion = '4.7.2'
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.13.2'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.SelfHelp.private.dll'
58-
59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
61-
62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
64-
65-
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = './Az.SelfHelp.format.ps1xml'
67-
68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
70-
71-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'Get-AzSelfHelpDiagnostic', 'Get-AzSelfHelpDiscoverySolution',
73-
'Get-AzSelfHelpSolution', 'Get-AzSelfHelpTroubleshooter',
74-
'Invoke-AzSelfHelpCheckNameAvailability',
75-
'Invoke-AzSelfHelpContinueTroubleshooter',
76-
'New-AzSelfHelpDiagnostic', 'New-AzSelfHelpSolution',
77-
'New-AzSelfHelpTroubleshooter', 'Restart-AzSelfHelpTroubleshooter',
78-
'Stop-AzSelfHelpTroubleshooter', 'Update-AzSelfHelpSolution'
79-
80-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
81-
CmdletsToExport = @()
82-
83-
# Variables to export from this module
84-
# VariablesToExport = @()
85-
86-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
87-
AliasesToExport = '*'
88-
89-
# DSC resources to export from this module
90-
# DscResourcesToExport = @()
91-
92-
# List of all modules packaged with this module
93-
# ModuleList = @()
94-
95-
# List of all files packaged with this module
96-
# FileList = @()
97-
98-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
99-
PrivateData = @{
100-
2+
GUID = '2705ffd2-39d8-491f-b0c6-14fca2dc3727'
3+
RootModule = './Az.SelfHelp.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: SelfHelp cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.SelfHelp.private.dll'
13+
FormatsToProcess = './Az.SelfHelp.format.ps1xml'
14+
FunctionsToExport = 'Get-AzSelfHelpDiagnostic', 'Get-AzSelfHelpDiscoverySolution', 'Get-AzSelfHelpSimplifiedSolution', 'Get-AzSelfHelpSolution', 'Get-AzSelfHelpSolutionSelfHelp', 'Get-AzSelfHelpTroubleshooter', 'Invoke-AzSelfHelpCheckNameAvailability', 'Invoke-AzSelfHelpContinueTroubleshooter', 'Invoke-AzSelfHelpDiscoverySolutionNlpSubscriptionScope', 'Invoke-AzSelfHelpDiscoverySolutionNlpTenantScope', 'Invoke-AzSelfHelpWarmSolutionUp', 'New-AzSelfHelpDiagnostic', 'New-AzSelfHelpSimplifiedSolution', 'New-AzSelfHelpSolution', 'New-AzSelfHelpTroubleshooter', 'Restart-AzSelfHelpTroubleshooter', 'Stop-AzSelfHelpTroubleshooter', 'Update-AzSelfHelpSolution', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
10117
PSData = @{
102-
103-
# Tags applied to this module. These help with module discovery in online galleries.
104-
Tags = 'Azure','ResourceManager','ARM','PSModule','SelfHelp'
105-
106-
# A URL to the license for this module.
107-
LicenseUri = 'https://aka.ms/azps-license'
108-
109-
# A URL to the main website for this project.
110-
ProjectUri = 'https://github.com/Azure/azure-powershell'
111-
112-
# A URL to an icon representing this module.
113-
# IconUri = ''
114-
115-
# ReleaseNotes of this module
116-
ReleaseNotes = '* Added support for discovery API as the first point of entry in Help RP.
117-
* Added support for new solution types (Diagnostics, Azure Solutions, Troubleshooters) in preview
118-
* Enabled customers to access Azure curated, relevant self-help solutions including diagnostics and Azure solutions at the resource and subscription scopes.
119-
* Implemented filter parameters such as solutionType, problemClassificationId/problemId, resourceId, and resourceType to enable customers to get more granular results through discovery API.
120-
* Enabled customers to trigger one or more applicable solutions such as diagnostics, components within Azure solutions, and Troubleshooters'
121-
122-
# Prerelease string of this module
123-
# Prerelease = ''
124-
125-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
126-
# RequireLicenseAcceptance = $false
127-
128-
# External dependent modules of this module
129-
# ExternalModuleDependencies = @()
130-
131-
} # End of PSData hashtable
132-
133-
} # End of PrivateData hashtable
134-
135-
# HelpInfo URI of this module
136-
# HelpInfoURI = ''
137-
138-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
139-
# DefaultCommandPrefix = ''
140-
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'SelfHelp'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
14124
}
142-

src/SelfHelp/SelfHelp.Autorest/Az.SelfHelp.psm1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,41 @@
4747

4848
# Ask for the shared functionality table
4949
$VTable = Register-AzModule
50-
50+
5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
5353

5454
# Following two delegates are added for telemetry
5555
$instance.GetTelemetryId = $VTable.GetTelemetryId
5656
$instance.Telemetry = $VTable.Telemetry
57-
57+
58+
# Delegate to sanitize the output object
59+
$instance.SanitizeOutput = $VTable.SanitizerHandler
60+
61+
# Delegate to get the telemetry info
62+
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo
5863

5964
# Tweaks the pipeline per call
6065
$instance.OnNewRequest = $VTable.OnNewRequest
61-
66+
6267
# Gets shared parameter values
6368
$instance.GetParameterValue = $VTable.GetParameterValue
64-
69+
6570
# Allows shared module to listen to events from this module
6671
$instance.EventListener = $VTable.EventListener
67-
72+
6873
# Gets shared argument completers
6974
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70-
75+
7176
# The name of the currently selected Azure profile
7277
$instance.ProfileName = $VTable.ProfileName
7378

74-
7579
# Load the custom module
7680
$customModulePath = Join-Path $PSScriptRoot './custom/Az.SelfHelp.custom.psm1'
7781
if(Test-Path $customModulePath) {
7882
$null = Import-Module -Name $customModulePath
7983
}
80-
84+
8185
# Export nothing to clear implicit exports
8286
Export-ModuleMember
8387

@@ -97,12 +101,12 @@
97101
# Load the last folder if no profile is selected
98102
$profileDirectory = $directories | Select-Object -Last 1
99103
}
100-
104+
101105
if($profileDirectory) {
102106
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103107
$exportsPath = $profileDirectory.FullName
104108
}
105-
109+
106110
if($exportsPath) {
107111
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108112
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath

src/SelfHelp/SelfHelp.Autorest/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the SelfHelp service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -30,10 +29,10 @@ For information on how to develop for `Az.SelfHelp`, see [how-to.md](how-to.md).
3029
3130
```yaml
3231
# pin the swagger version by using the commit id instead of branch name
33-
branch: 270eeb7a7883e0ad4e183e809fb67c6551d0eaa0
32+
commit: 1145a0df0f91b5f0f1f5ab66667899a61eda5e2b
3433
require:
3534
# readme.azure.noprofile.md is the common configuration file
36-
- $(this-folder)/../readme.azure.noprofile.md
35+
- $(this-folder)/../../readme.azure.noprofile.md
3736
- $(repo)/specification/help/resource-manager/readme.md
3837
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
3938
# - $(this-folder)/azure-rest-api-specs/specification/help/resource-manager/readme.md
@@ -53,6 +52,10 @@ subject-prefix: $(service-name)
5352
resourcegroup-append: true
5453
nested-object-to-string: true
5554

55+
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
56+
use-extension:
57+
"@autorest/powershell": "3.x"
58+
5659
directive:
5760
# Following is two common directive which are normally required in all the RPs
5861
# 1. Remove the unexpanded parameter set

src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/diagnostics.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "diagnostics",
3-
"apiVersion": "2023-09-01-preview",
3+
"apiVersion": "2024-03-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
66
},
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"resourceType": "selfHelp",
3+
"apiVersion": "2024-03-01-preview",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSelfHelpSolutionSelfHelp",
10+
"description": "Finds and Executes a Self Help Solution based on the Solution Id.\nThese are static self help content to help users troubleshoot their issues.",
11+
"path": "/providers/Microsoft.Help/selfHelp/{solutionId}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/get-azselfhelpsolutionselfhelp"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-SolutionId <String>"
20+
]
21+
}
22+
]
23+
},
24+
"examples": [
25+
{
26+
"description": "Finds and Executes a Self Help Solution based on the Solution Id. These are static self help content to help users troubleshoot their issues.",
27+
"parameters": [
28+
{
29+
"name": "-SolutionId",
30+
"value": "[Path.solutionId]"
31+
}
32+
]
33+
}
34+
]
35+
}
36+
]
37+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"resourceType": "simplifiedSolutions",
3+
"apiVersion": "2024-03-01-preview",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSelfHelpSimplifiedSolution",
10+
"description": "Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions.",
11+
"path": "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/get-azselfhelpsimplifiedsolution"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-SResourceName <String>",
20+
"-Scope <String>"
21+
]
22+
}
23+
]
24+
},
25+
"examples": [
26+
{
27+
"description": "Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions.",
28+
"parameters": [
29+
{
30+
"name": "-SResourceName",
31+
"value": "[Path.simplifiedSolutionsResourceName]"
32+
},
33+
{
34+
"name": "-Scope",
35+
"value": "[Path.scope]"
36+
}
37+
]
38+
}
39+
]
40+
}
41+
]
42+
}

src/SelfHelp/SelfHelp.Autorest/UX/Microsoft.Help/solutions.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "solutions",
3-
"apiVersion": "2023-09-01-preview",
3+
"apiVersion": "2024-03-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp"
66
},
@@ -37,6 +37,39 @@
3737
]
3838
}
3939
]
40+
},
41+
{
42+
"name": "Invoke-AzSelfHelpWarmSolutionUp",
43+
"description": "Warm up the solution resource by preloading asynchronous diagnostics results into cache",
44+
"path": "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}/warmup",
45+
"help": {
46+
"learnMore": {
47+
"url": "https://learn.microsoft.com/powershell/module/az.selfhelp/invoke-azselfhelpwarmsolutionup"
48+
},
49+
"parameterSets": [
50+
{
51+
"parameters": [
52+
"-Scope <String>",
53+
"-SolutionResourceName <String>"
54+
]
55+
}
56+
]
57+
},
58+
"examples": [
59+
{
60+
"description": "Warm up the solution resource by preloading asynchronous diagnostics results into cache",
61+
"parameters": [
62+
{
63+
"name": "-Scope",
64+
"value": "[Path.scope]"
65+
},
66+
{
67+
"name": "-SolutionResourceName",
68+
"value": "[Path.solutionResourceName]"
69+
}
70+
]
71+
}
72+
]
4073
}
4174
]
4275
}

0 commit comments

Comments
 (0)