Skip to content

Commit 6d1d151

Browse files
Refresh autorest-selected modules from generation to main (#24716)
1 parent 08d35c8 commit 6d1d151

File tree

592 files changed

+18423
-2330
lines changed

Some content is hidden

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

592 files changed

+18423
-2330
lines changed
Lines changed: 21 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,24 @@
1-
#
2-
# Module manifest for module 'Az.DedicatedHsm'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 4/22/2022
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.DedicatedHsm.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.3.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = '841c2fad-e8c0-4924-b9b9-9d27d0f40b48'
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: DedicatedHsm 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.7.6'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.DedicatedHsm.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.DedicatedHsm.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-AzDedicatedHsm',
73-
'Get-AzDedicatedHsmOutboundNetworkDependencyEndpoint',
74-
'New-AzDedicatedHsm', 'Remove-AzDedicatedHsm',
75-
'Update-AzDedicatedHsm'
76-
77-
# 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.
78-
CmdletsToExport = @()
79-
80-
# Variables to export from this module
81-
# VariablesToExport = @()
82-
83-
# 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.
84-
AliasesToExport = '*'
85-
86-
# DSC resources to export from this module
87-
# DscResourcesToExport = @()
88-
89-
# List of all modules packaged with this module
90-
# ModuleList = @()
91-
92-
# List of all files packaged with this module
93-
# FileList = @()
94-
95-
# 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.
96-
PrivateData = @{
97-
2+
GUID = '841c2fad-e8c0-4924-b9b9-9d27d0f40b48'
3+
RootModule = './Az.DedicatedHsm.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: DedicatedHsm cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.DedicatedHsm.private.dll'
13+
FormatsToProcess = './Az.DedicatedHsm.format.ps1xml'
14+
FunctionsToExport = 'Get-AzDedicatedHsm', 'Get-AzDedicatedHsmOutboundNetworkDependencyEndpoint', 'New-AzDedicatedHsm', 'Remove-AzDedicatedHsm', 'Update-AzDedicatedHsm', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
9817
PSData = @{
99-
100-
# Tags applied to this module. These help with module discovery in online galleries.
101-
Tags = 'Azure','ResourceManager','ARM','PSModule','DedicatedHsm'
102-
103-
# A URL to the license for this module.
104-
LicenseUri = 'https://aka.ms/azps-license'
105-
106-
# A URL to the main website for this project.
107-
ProjectUri = 'https://github.com/Azure/azure-powershell'
108-
109-
# A URL to an icon representing this module.
110-
# IconUri = ''
111-
112-
# ReleaseNotes of this module
113-
ReleaseNotes = '* Updated API version to 2021-11-03
114-
- Added ''Get-AzDedicatedHsmOutboundNetworkDependencyEndpoint'''
115-
116-
# Prerelease string of this module
117-
# Prerelease = ''
118-
119-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
120-
# RequireLicenseAcceptance = $false
121-
122-
# External dependent modules of this module
123-
# ExternalModuleDependencies = @()
124-
125-
} # End of PSData hashtable
126-
127-
} # End of PrivateData hashtable
128-
129-
# HelpInfo URI of this module
130-
# HelpInfoURI = ''
131-
132-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
133-
# DefaultCommandPrefix = ''
134-
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DedicatedHsm'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
13524
}
136-

src/DedicatedHsm/DedicatedHsm.Autorest/Az.DedicatedHsm.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.DedicatedHsm.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/DedicatedHsm/DedicatedHsm.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 DedicatedHsm service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -46,8 +45,8 @@ In this directory, run AutoRest:
4645
4746
``` yaml
4847
require:
49-
- $(this-folder)/../readme.azure.noprofile.md
50-
branch: f203c1b73639b7e2f85aa96902cfe36c6dd2ffad
48+
- $(this-folder)/../../readme.azure.noprofile.md
49+
commit: f203c1b73639b7e2f85aa96902cfe36c6dd2ffad
5150
input-file:
5251
- $(repo)/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/dedicatedhsm.json
5352

@@ -61,6 +60,10 @@ subject-prefix: $(service-name)
6160
# uncomment following line to support viaIdentity for these post APIs
6261
# identity-correction-for-post: true
6362

63+
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
64+
use-extension:
65+
"@autorest/powershell": "3.x"
66+
6467
directive:
6568
# Following is two common directive which are normally required in all the RPs
6669
# 1. Remove the unexpanded parameter set

src/DedicatedHsm/DedicatedHsm.Autorest/build-module.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

124124
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
125125
$modelCmdlets = @()
126+
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
127+
if (Test-Path $modelCmdletFolder) {
128+
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
129+
}
126130
if ($modelCmdlets.Count -gt 0) {
127131
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
128132
CreateModelCmdlet($modelCmdlets)
@@ -139,7 +143,8 @@ if($NoDocs) {
139143
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
140144
}
141145
$null = New-Item -ItemType Directory -Force -Path $docsFolder
142-
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
146+
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
147+
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
143148
}
144149

145150
Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
@@ -158,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
158163
Write-Host -ForegroundColor Green 'Creating example stubs...'
159164
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
160165

166+
if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
167+
{
168+
Write-Host -ForegroundColor Green 'Creating ux metadata...'
169+
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
170+
}
171+
161172
Write-Host -ForegroundColor Green '-------------Done-------------'

src/DedicatedHsm/DedicatedHsm.Autorest/check-dependencies.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(-not $Isolated) {
2525
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
2626
if($predicate) {
2727
$module = Get-Module -ListAvailable -Name $moduleName
28-
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
28+
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
2929
$null = New-Item -ItemType Directory -Force -Path $path
3030
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
3131
if ($requiredVersion) {

src/DedicatedHsm/DedicatedHsm.Autorest/create-model-cmdlets.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'DedicatedHsm'
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if (''.length -gt 0) {
29+
$ModuleName = ''
30+
} else {
31+
$ModuleName = 'Az.DedicatedHsm'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('DedicatedHsm')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'DedicatedHsm'
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
158162
.Outputs
159163
${ObjectTypeWithNamespace}
160164
.Link
161-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162166
#>
163167
function New-Az${ModulePrefix}${ObjectType}Object {
164168
[OutputType('${ObjectTypeWithNamespace}')]

src/DedicatedHsm/DedicatedHsm.Autorest/examples/Update-AzDedicatedHsm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ This command updates the parameter tag of the Dedicated HSM by name
1313

1414
### Example 2: Update the parameter tag of the Dedicated HSM by object
1515
```powershell
16-
$hsm = Get-AzDedicatedHsm -Name hsm-n7wfxi -ResourceGroupName dedicatedhsm-rg-n359cz
17-
Update-AzDedicatedHsm -InputObject -Tag @{'key1' = '1'; 'key2' = 2; 'key3' = 3}
16+
$hsm = Get-AzDedicatedHsm -Name hsm-n7wfxi -ResourceGroupName dedicatedhsm-rg-n359cz
17+
Update-AzDedicatedHsm -InputObject $hsm -Tag @{'key1' = '1'; 'key2' = 2; 'key3' = 3}
1818
```
1919

2020
```output

src/DedicatedHsm/DedicatedHsm.Autorest/exports/Get-AzDedicatedHsm.ps1

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ param(
9292
[ValidateNotNull()]
9393
[Microsoft.Azure.PowerShell.Cmdlets.DedicatedHsm.Category('Azure')]
9494
[System.Management.Automation.PSObject]
95-
# The credentials, account, tenant, and subscription used for communication with Azure.
95+
# The DefaultProfile parameter is not functional.
96+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
9697
${DefaultProfile},
9798

9899
[Parameter(DontShow)]
@@ -144,7 +145,7 @@ begin {
144145
$parameterSet = $PSCmdlet.ParameterSetName
145146

146147
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
147-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString()
148+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
148149
}
149150
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
150151
if ($preTelemetryId -eq '') {
@@ -167,10 +168,20 @@ begin {
167168
List1 = 'Az.DedicatedHsm.private\Get-AzDedicatedHsm_List1';
168169
}
169170
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
170-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
171+
$testPlayback = $false
172+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DedicatedHsm.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
173+
if ($testPlayback) {
174+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
175+
} else {
176+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
177+
}
171178
}
172179
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
173180
[Microsoft.Azure.PowerShell.Cmdlets.DedicatedHsm.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
181+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.DedicatedHsm.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
182+
[Microsoft.Azure.PowerShell.Cmdlets.DedicatedHsm.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
183+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
184+
}
174185
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
175186
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
176187
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

0 commit comments

Comments
 (0)