Skip to content

Commit e8a3e6d

Browse files
azure-powershell-botLei Jin
andauthored
Migrate DataMigration from generation to main (#21796)
* Move DataMigration to main * Update ChangeLog.md --------- Co-authored-by: Lei Jin <[email protected]>
1 parent c2895db commit e8a3e6d

File tree

120 files changed

+1471
-365
lines changed

Some content is hidden

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

120 files changed

+1471
-365
lines changed
Lines changed: 21 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,24 @@
1-
#
2-
# Module manifest for module 'Az.DataMigration'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 1/27/2022
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.DataMigration.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.1.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'e23fee23-903d-423e-9275-f8763efede9d'
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: DataMigration 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.4'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.DataMigration.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.DataMigration.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-AzDataMigrationAssessment', 'Get-AzDataMigrationSqlService',
73-
'Get-AzDataMigrationSqlServiceAuthKey',
74-
'Get-AzDataMigrationSqlServiceIntegrationRuntimeMetric',
75-
'Get-AzDataMigrationSqlServiceMigration',
76-
'Get-AzDataMigrationToSqlManagedInstance',
77-
'Get-AzDataMigrationToSqlVM',
78-
'Invoke-AzDataMigrationCutoverToSqlManagedInstance',
79-
'Invoke-AzDataMigrationCutoverToSqlVM',
80-
'New-AzDataMigrationSqlService',
81-
'New-AzDataMigrationSqlServiceAuthKey',
82-
'New-AzDataMigrationToSqlManagedInstance',
83-
'New-AzDataMigrationToSqlVM',
84-
'Register-AzDataMigrationIntegrationRuntime',
85-
'Remove-AzDataMigrationSqlService',
86-
'Remove-AzDataMigrationSqlServiceNode',
87-
'Stop-AzDataMigrationToSqlManagedInstance',
88-
'Stop-AzDataMigrationToSqlVM', 'Update-AzDataMigrationSqlService'
89-
90-
# 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.
91-
CmdletsToExport = @()
92-
93-
# Variables to export from this module
94-
# VariablesToExport = @()
95-
96-
# 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.
97-
AliasesToExport = '*'
98-
99-
# DSC resources to export from this module
100-
# DscResourcesToExport = @()
101-
102-
# List of all modules packaged with this module
103-
# ModuleList = @()
104-
105-
# List of all files packaged with this module
106-
# FileList = @()
107-
108-
# 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.
109-
PrivateData = @{
110-
2+
GUID = 'e23fee23-903d-423e-9275-f8763efede9d'
3+
RootModule = './Az.DataMigration.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: DataMigration cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.DataMigration.private.dll'
13+
FormatsToProcess = './Az.DataMigration.format.ps1xml'
14+
FunctionsToExport = 'Get-AzDataMigrationAssessment', 'Get-AzDataMigrationPerformanceDataCollection', 'Get-AzDataMigrationSkuRecommendation', 'Get-AzDataMigrationSqlService', 'Get-AzDataMigrationSqlServiceAuthKey', 'Get-AzDataMigrationSqlServiceIntegrationRuntimeMetric', 'Get-AzDataMigrationSqlServiceMigration', 'Get-AzDataMigrationToSqlDb', 'Get-AzDataMigrationToSqlManagedInstance', 'Get-AzDataMigrationToSqlVM', 'Invoke-AzDataMigrationCutoverToSqlManagedInstance', 'Invoke-AzDataMigrationCutoverToSqlVM', 'New-AzDataMigrationLoginsMigration', 'New-AzDataMigrationSqlService', 'New-AzDataMigrationSqlServiceAuthKey', 'New-AzDataMigrationTdeCertificateMigration', 'New-AzDataMigrationToSqlDb', 'New-AzDataMigrationToSqlManagedInstance', 'New-AzDataMigrationToSqlVM', 'Register-AzDataMigrationIntegrationRuntime', 'Remove-AzDataMigrationSqlService', 'Remove-AzDataMigrationSqlServiceNode', 'Remove-AzDataMigrationToSqlDb', 'Stop-AzDataMigrationToSqlDb', 'Stop-AzDataMigrationToSqlManagedInstance', 'Stop-AzDataMigrationToSqlVM', 'Update-AzDataMigrationSqlService', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
11117
PSData = @{
112-
113-
# Tags applied to this module. These help with module discovery in online galleries.
114-
Tags = 'Azure','ResourceManager','ARM','PSModule','DataMigration'
115-
116-
# A URL to the license for this module.
117-
LicenseUri = 'https://aka.ms/azps-license'
118-
119-
# A URL to the main website for this project.
120-
ProjectUri = 'https://github.com/Azure/azure-powershell'
121-
122-
# A URL to an icon representing this module.
123-
# IconUri = ''
124-
125-
# ReleaseNotes of this module
126-
# ReleaseNotes = ''
127-
128-
# Prerelease string of this module
129-
# Prerelease = ''
130-
131-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
132-
# RequireLicenseAcceptance = $false
133-
134-
# External dependent modules of this module
135-
# ExternalModuleDependencies = @()
136-
137-
} # End of PSData hashtable
138-
139-
} # End of PrivateData hashtable
140-
141-
# HelpInfo URI of this module
142-
# HelpInfoURI = ''
143-
144-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
145-
# DefaultCommandPrefix = ''
146-
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DataMigration'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
14724
}
148-

src/DataMigration/DataMigration.Autorest/Az.DataMigration.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434

3535
if(-not $accountsModule) {
36-
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
36+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
3737
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
3838
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
3939
}

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

Lines changed: 4 additions & 0 deletions
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)

src/DataMigration/DataMigration.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 = 'DataMigration'
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.DataMigration'
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('DataMigration')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'DataMigration'
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}')]

0 commit comments

Comments
 (0)