Skip to content

Commit 347d0a7

Browse files
Migrate StorageMover from generation to main (#22009)
* Move StorageMover to main * Update ChangeLog.md --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent 42f86ed commit 347d0a7

File tree

116 files changed

+412
-277
lines changed

Some content is hidden

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

116 files changed

+412
-277
lines changed

src/StorageMover/Az.StorageMover.psd1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 3/6/2023
6+
# Generated on: 6/7/2023
77
#
88

99
@{
@@ -122,8 +122,7 @@ PrivateData = @{
122122
# IconUri = ''
123123

124124
# ReleaseNotes of this module
125-
ReleaseNotes = '* General availability for module Az.StorageMover
126-
* Updated StorageMover API version to 2023-03-01'
125+
# ReleaseNotes = ''
127126

128127
# Prerelease string of this module
129128
# Prerelease = ''

src/StorageMover/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fix the issue of $Host conflicting with system parameter $Host
2122

2223
## Version 1.0.0
2324
* General availability for module Az.StorageMover

src/StorageMover/StorageMover.sln

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{57230BF4-4D35-4075-96D1-7746C6435727}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{3716E4F5-4879-4541-B02A-FC91A9DD456A}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{55E30484-DAC7-4E1A-8001-21DA331427CF}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{2B52CF8B-A8A3-4ADE-BA9B-C5AD40B51BB3}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{106A5185-D14B-44C7-A24C-C8AEE1EA345C}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{1F20359A-BE1B-4308-ACEF-885509B260AA}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{1C111710-6E36-4C6F-931E-9DB9F07D20BC}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{83DE0EB5-3BBD-4C7D-ADC3-C9ECB31584A4}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{87C9D60A-A01B-4257-8DE9-6D3A251E77CE}"
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{267B0F8F-8D51-45F9-A904-38BB45D3416E}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{C52134F8-882C-4EC9-BCF2-786AC03C9123}"
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{1DCB3AC3-BDF6-4C58-80C4-1C55FA90CBBE}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StorageMover", "Az.StorageMover.csproj", "{19FA5433-2347-479D-A3ED-DB1B0EA2D851}"
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StorageMover", "Az.StorageMover.csproj", "{D01B6C61-8B9F-447A-9893-64CFB6999C7D}"
1919
EndProject
2020
Global
2121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -26,33 +26,33 @@ Global
2626
HideSolutionNode = FALSE
2727
EndGlobalSection
2828
GlobalSection(ProjectConfigurationPlatforms) = postSolution
29-
{57230BF4-4D35-4075-96D1-7746C6435727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{57230BF4-4D35-4075-96D1-7746C6435727}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{57230BF4-4D35-4075-96D1-7746C6435727}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{57230BF4-4D35-4075-96D1-7746C6435727}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{55E30484-DAC7-4E1A-8001-21DA331427CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{55E30484-DAC7-4E1A-8001-21DA331427CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{55E30484-DAC7-4E1A-8001-21DA331427CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{55E30484-DAC7-4E1A-8001-21DA331427CF}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{106A5185-D14B-44C7-A24C-C8AEE1EA345C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{106A5185-D14B-44C7-A24C-C8AEE1EA345C}.Debug|Any CPU.Build.0 = Debug|Any CPU
39-
{106A5185-D14B-44C7-A24C-C8AEE1EA345C}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{106A5185-D14B-44C7-A24C-C8AEE1EA345C}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{1C111710-6E36-4C6F-931E-9DB9F07D20BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{1C111710-6E36-4C6F-931E-9DB9F07D20BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{1C111710-6E36-4C6F-931E-9DB9F07D20BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{1C111710-6E36-4C6F-931E-9DB9F07D20BC}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{87C9D60A-A01B-4257-8DE9-6D3A251E77CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{87C9D60A-A01B-4257-8DE9-6D3A251E77CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
47-
{87C9D60A-A01B-4257-8DE9-6D3A251E77CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
48-
{87C9D60A-A01B-4257-8DE9-6D3A251E77CE}.Release|Any CPU.Build.0 = Release|Any CPU
49-
{C52134F8-882C-4EC9-BCF2-786AC03C9123}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50-
{C52134F8-882C-4EC9-BCF2-786AC03C9123}.Debug|Any CPU.Build.0 = Debug|Any CPU
51-
{C52134F8-882C-4EC9-BCF2-786AC03C9123}.Release|Any CPU.ActiveCfg = Release|Any CPU
52-
{C52134F8-882C-4EC9-BCF2-786AC03C9123}.Release|Any CPU.Build.0 = Release|Any CPU
53-
{19FA5433-2347-479D-A3ED-DB1B0EA2D851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54-
{19FA5433-2347-479D-A3ED-DB1B0EA2D851}.Debug|Any CPU.Build.0 = Debug|Any CPU
55-
{19FA5433-2347-479D-A3ED-DB1B0EA2D851}.Release|Any CPU.ActiveCfg = Release|Any CPU
56-
{19FA5433-2347-479D-A3ED-DB1B0EA2D851}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{3716E4F5-4879-4541-B02A-FC91A9DD456A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{3716E4F5-4879-4541-B02A-FC91A9DD456A}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{3716E4F5-4879-4541-B02A-FC91A9DD456A}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{3716E4F5-4879-4541-B02A-FC91A9DD456A}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{2B52CF8B-A8A3-4ADE-BA9B-C5AD40B51BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{2B52CF8B-A8A3-4ADE-BA9B-C5AD40B51BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{2B52CF8B-A8A3-4ADE-BA9B-C5AD40B51BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{2B52CF8B-A8A3-4ADE-BA9B-C5AD40B51BB3}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{1F20359A-BE1B-4308-ACEF-885509B260AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{1F20359A-BE1B-4308-ACEF-885509B260AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{1F20359A-BE1B-4308-ACEF-885509B260AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{1F20359A-BE1B-4308-ACEF-885509B260AA}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{83DE0EB5-3BBD-4C7D-ADC3-C9ECB31584A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{83DE0EB5-3BBD-4C7D-ADC3-C9ECB31584A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{83DE0EB5-3BBD-4C7D-ADC3-C9ECB31584A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{83DE0EB5-3BBD-4C7D-ADC3-C9ECB31584A4}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{267B0F8F-8D51-45F9-A904-38BB45D3416E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{267B0F8F-8D51-45F9-A904-38BB45D3416E}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{267B0F8F-8D51-45F9-A904-38BB45D3416E}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{267B0F8F-8D51-45F9-A904-38BB45D3416E}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{1DCB3AC3-BDF6-4C58-80C4-1C55FA90CBBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{1DCB3AC3-BDF6-4C58-80C4-1C55FA90CBBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{1DCB3AC3-BDF6-4C58-80C4-1C55FA90CBBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{1DCB3AC3-BDF6-4C58-80C4-1C55FA90CBBE}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{D01B6C61-8B9F-447A-9893-64CFB6999C7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{D01B6C61-8B9F-447A-9893-64CFB6999C7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{D01B6C61-8B9F-447A-9893-64CFB6999C7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{D01B6C61-8B9F-447A-9893-64CFB6999C7D}.Release|Any CPU.Build.0 = Release|Any CPU
5757
EndGlobalSection
5858
EndGlobal

src/StorageMover/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/StorageMover/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 = 'StorageMover'
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.StorageMover'
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('StorageMover')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'StorageMover'
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/StorageMover/exports/Get-AzStorageMover.ps1

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

9495
[Parameter(DontShow)]
@@ -140,7 +141,7 @@ begin {
140141
$parameterSet = $PSCmdlet.ParameterSetName
141142

142143
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
143-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
144+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
144145
}
145146
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
146147
if ($preTelemetryId -eq '') {

src/StorageMover/exports/Get-AzStorageMoverAgent.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ param(
9292
[ValidateNotNull()]
9393
[Microsoft.Azure.PowerShell.Cmdlets.StorageMover.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.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 '') {

src/StorageMover/exports/Get-AzStorageMoverEndpoint.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ param(
9292
[ValidateNotNull()]
9393
[Microsoft.Azure.PowerShell.Cmdlets.StorageMover.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.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 '') {

src/StorageMover/exports/Get-AzStorageMoverJobDefinition.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ param(
9999
[ValidateNotNull()]
100100
[Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Azure')]
101101
[System.Management.Automation.PSObject]
102-
# The credentials, account, tenant, and subscription used for communication with Azure.
102+
# The DefaultProfile parameter is not functional.
103+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
103104
${DefaultProfile},
104105

105106
[Parameter(DontShow)]
@@ -151,7 +152,7 @@ begin {
151152
$parameterSet = $PSCmdlet.ParameterSetName
152153

153154
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
154-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
155+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
155156
}
156157
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
157158
if ($preTelemetryId -eq '') {

src/StorageMover/exports/Get-AzStorageMoverJobRun.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ param(
106106
[ValidateNotNull()]
107107
[Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Azure')]
108108
[System.Management.Automation.PSObject]
109-
# The credentials, account, tenant, and subscription used for communication with Azure.
109+
# The DefaultProfile parameter is not functional.
110+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
110111
${DefaultProfile},
111112

112113
[Parameter(DontShow)]
@@ -158,7 +159,7 @@ begin {
158159
$parameterSet = $PSCmdlet.ParameterSetName
159160

160161
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
161-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
162+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
162163
}
163164
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
164165
if ($preTelemetryId -eq '') {

0 commit comments

Comments
 (0)