Skip to content

Commit 3e5a926

Browse files
author
Sam Lee
committed
Small bug fix
1 parent b7bb89a commit 3e5a926

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalDiskMappingObject.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ function New-AzMigrateLocalDiskMappingObject {
7474
process {
7575
$isDynamicDisk = [System.Convert]::ToBoolean($IsDynamic)
7676
$osDisk = [System.Convert]::ToBoolean($IsOSDisk)
77+
$hasPhysicalSectorSize = $PSBoundParameters.ContainsKey('PhysicalSectorSize')
7778

78-
if ($Format -eq "VHD" -and $PhysicalSectorSize -ne 512) {
79-
throw "PhysicalSectorSize must be 512 for VHD format."
79+
if ($Format -eq "VHD" -and $hasPhysicalSectorSize -and $PhysicalSectorSize -ne 512) {
80+
throw "PhysicalSectorSize must be 512 for VHD format but $PhysicalSectorSize is given."
8081
}
8182

8283
$DiskObject = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.AzLocalDiskInput]::new(

src/Migrate/Migrate.sln

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migrate", "Migrate\Migrate.
2121
EndProject
2222
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Migrate.Autorest", "Migrate.Autorest", "{9AA2C35A-2264-B74D-8556-EB72BD88EE60}"
2323
EndProject
24-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Migrate", "Migrate.Autorest\Az.Migrate.csproj", "{214A468C-8ED4-41E0-883E-35C53A36AA7A}"
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Migrate", "Migrate.Autorest\Az.Migrate.csproj", "{981CB48A-7178-4D26-9605-682E1DDC62C8}"
2525
EndProject
2626
Global
2727
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -117,18 +117,18 @@ Global
117117
{1847EC8D-87A5-4772-9E75-1DEA1DC531EE}.Release|x64.Build.0 = Release|Any CPU
118118
{1847EC8D-87A5-4772-9E75-1DEA1DC531EE}.Release|x86.ActiveCfg = Release|Any CPU
119119
{1847EC8D-87A5-4772-9E75-1DEA1DC531EE}.Release|x86.Build.0 = Release|Any CPU
120-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
122-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x64.ActiveCfg = Debug|Any CPU
123-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x64.Build.0 = Debug|Any CPU
124-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x86.ActiveCfg = Debug|Any CPU
125-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x86.Build.0 = Debug|Any CPU
126-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
127-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|Any CPU.Build.0 = Release|Any CPU
128-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x64.ActiveCfg = Release|Any CPU
129-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x64.Build.0 = Release|Any CPU
130-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x86.ActiveCfg = Release|Any CPU
131-
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x86.Build.0 = Release|Any CPU
120+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
122+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Debug|x64.ActiveCfg = Debug|Any CPU
123+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Debug|x64.Build.0 = Debug|Any CPU
124+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Debug|x86.ActiveCfg = Debug|Any CPU
125+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Debug|x86.Build.0 = Debug|Any CPU
126+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
127+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Release|Any CPU.Build.0 = Release|Any CPU
128+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Release|x64.ActiveCfg = Release|Any CPU
129+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Release|x64.Build.0 = Release|Any CPU
130+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Release|x86.ActiveCfg = Release|Any CPU
131+
{981CB48A-7178-4D26-9605-682E1DDC62C8}.Release|x86.Build.0 = Release|Any CPU
132132
EndGlobalSection
133133
GlobalSection(SolutionProperties) = preSolution
134134
HideSolutionNode = FALSE
@@ -140,6 +140,6 @@ Global
140140
{FB2B969F-E6FB-4E6E-9D2A-E52F4F53F51F} = {2D0176AD-AE30-4235-9D62-17043F0D4CD8}
141141
{D8D28132-CE20-45C8-8476-6B88C891D945} = {2D0176AD-AE30-4235-9D62-17043F0D4CD8}
142142
{B799EA2F-9E28-421A-9301-BB061C6ADDC2} = {2D0176AD-AE30-4235-9D62-17043F0D4CD8}
143-
{214A468C-8ED4-41E0-883E-35C53A36AA7A} = {9AA2C35A-2264-B74D-8556-EB72BD88EE60}
143+
{981CB48A-7178-4D26-9605-682E1DDC62C8} = {9AA2C35A-2264-B74D-8556-EB72BD88EE60}
144144
EndGlobalSection
145145
EndGlobal

0 commit comments

Comments
 (0)