Skip to content

Commit 7cd6342

Browse files
Refresh autorest-selected modules from ADDomainServices to Confluent (#24686)
* Refresh autorest-selected modules from wyunchi/generation/pipeline-refresh-autorest to main * Skip static analysis --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent 9b8fa19 commit 7cd6342

File tree

1,645 files changed

+49146
-10213
lines changed

Some content is hidden

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

1,645 files changed

+49146
-10213
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.ADDomainServices'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 6/30/2022
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.ADDomainServices.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.2.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'bba49006-4c09-406e-8fad-dd48d1b381e7'
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: AdDomainServices 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.9.0'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.ADDomainServices.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.ADDomainServices.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-AzADDomainService', 'New-AzADDomainService',
73-
'New-AzADDomainServiceForestTrustObject',
74-
'New-AzADDomainServiceReplicaSetObject', 'Remove-AzADDomainService',
75-
'Update-AzADDomainService'
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 = 'bba49006-4c09-406e-8fad-dd48d1b381e7'
3+
RootModule = './Az.ADDomainServices.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: AdDomainServices cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.ADDomainServices.private.dll'
13+
FormatsToProcess = './Az.ADDomainServices.format.ps1xml'
14+
FunctionsToExport = 'Get-AzADDomainService', 'New-AzADDomainService', 'New-AzADDomainServiceForestTrustObject', 'New-AzADDomainServiceReplicaSetObject', 'Remove-AzADDomainService', 'Update-AzADDomainService', '*'
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','AdDomainServices'
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 = '* Changed the input method of certificate from base64 string to file path
114-
* Renamed ''New-AzADDomainServiceForestTrust'' to ''New-AzADDomainServiceForestTrustObject'', and ''New-AzADDomainServiceReplicaSet'' to ''New-AzADDomainServiceReplicaSetObject'' to align with naming convention'
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', 'AdDomainServices'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
13524
}
136-

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

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -28,10 +27,10 @@ For information on how to develop for `Az.ADDomainServices`, see [how-to.md](how
2827
> see https://aka.ms/autorest
2928
3029
``` yaml
31-
branch: 394ab556cb4aed1196918856a24be9b02609cc93
30+
commit: 394ab556cb4aed1196918856a24be9b02609cc93
3231
require:
3332
# readme.azure.noprofile.md is the common configuration file
34-
- $(this-folder)/../readme.azure.noprofile.md
33+
- $(this-folder)/../../readme.azure.noprofile.md
3534
input-file:
3635
# You need to specify your swagger files here.
3736
- $(repo)/specification/domainservices/resource-manager/Microsoft.AAD/stable/2020-01-01/domainservices.json
@@ -50,6 +49,10 @@ subject-prefix: ADDomainService
5049
# identity-correction-for-post: true
5150
resourcegroup-append: true
5251

52+
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
53+
use-extension:
54+
"@autorest/powershell": "3.x"
55+
5356
directive:
5457
- from: swagger-document
5558
where: $.definitions..pfxCertificatePassword

src/ADDomainServices/ADDomainServices.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 = @('ForestTrust', 'ReplicaSet')
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/ADDomainServices/ADDomainServices.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 = 'ADDomainService'
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.ADDomainServices'
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('ADDomainService')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'ADDomainService'
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/ADDomainServices/ADDomainServices.Autorest/custom/autogen-model-cmdlets/New-AzADDomainServiceForestTrustObject.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Create an in-memory object for ForestTrust.
2323
.Outputs
2424
Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ForestTrust
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.ADDomainService/new-AzADDomainServiceForestTrustObject
26+
https://learn.microsoft.com/powershell/module/Az.ADDomainServices/new-AzADDomainServiceForestTrustObject
2727
#>
2828
function New-AzADDomainServiceForestTrustObject {
2929
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ForestTrust')]

src/ADDomainServices/ADDomainServices.Autorest/custom/autogen-model-cmdlets/New-AzADDomainServiceReplicaSetObject.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Create an in-memory object for ReplicaSet.
2323
.Outputs
2424
Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ReplicaSet
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.ADDomainService/new-AzADDomainServiceReplicaSetObject
26+
https://learn.microsoft.com/powershell/module/Az.ADDomainServices/new-AzADDomainServiceReplicaSetObject
2727
#>
2828
function New-AzADDomainServiceReplicaSetObject {
2929
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Models.Api202001.ReplicaSet')]

src/ADDomainServices/ADDomainServices.Autorest/examples/New-AzADDomainService.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Create a new ADDomainService
1616
```powershell
1717
# Variables
1818
$replicaSet = New-AzADDomainServiceReplicaSet -Location westus -SubnetId /subscriptions/********-****-****-****-**********/resourceGroups/yishitest/providers/Microsoft.Network/virtualNetworks/aadds-vnet/subnets/default\
19-
$certificateBytes = get-content "certificate.pfx" -AsByteStream
19+
$certificateBytes = Get-Content "certificate.pfx" -AsByteStream
2020
$base64String = [System.Convert]::ToBase64String($certificateBytes)
2121
$ldaps_pfx_pass = "MyStrongPassword"
2222
23-
New-AzADDomainService -name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet -LdapSettingLdaps Enabled -LdapSettingPfxCertificate $base64String -LdapSettingPfxCertificatePassword $($ldaps_pfx_pass | ConvertTo-SecureString -Force -AsPlainText)
23+
New-AzADDomainService -Name youriADdomain -ResourceGroupName youriAddomain -DomainName youriAddomain.com -ReplicaSet $replicaSet -LdapSettingLdaps Enabled -LdapSettingPfxCertificate $base64String -LdapSettingPfxCertificatePassword $($ldaps_pfx_pass | ConvertTo-SecureString -Force -AsPlainText)
2424
```
2525

2626
```output

src/ADDomainServices/ADDomainServices.Autorest/exports/Get-AzADDomainService.ps1

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ param(
8787
[ValidateNotNull()]
8888
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Category('Azure')]
8989
[System.Management.Automation.PSObject]
90-
# The credentials, account, tenant, and subscription used for communication with Azure.
90+
# The DefaultProfile parameter is not functional.
91+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
9192
${DefaultProfile},
9293

9394
[Parameter(DontShow)]
@@ -139,7 +140,7 @@ begin {
139140
$parameterSet = $PSCmdlet.ParameterSetName
140141

141142
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
142-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
143+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
143144
}
144145
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
145146
if ($preTelemetryId -eq '') {
@@ -162,10 +163,20 @@ begin {
162163
List1 = 'Az.ADDomainServices.private\Get-AzADDomainService_List1';
163164
}
164165
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
165-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
166+
$testPlayback = $false
167+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
168+
if ($testPlayback) {
169+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
170+
} else {
171+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
172+
}
166173
}
167174
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
168175
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
176+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
177+
[Microsoft.Azure.PowerShell.Cmdlets.ADDomainServices.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
178+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
179+
}
169180
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
170181
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
171182
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

0 commit comments

Comments
 (0)