diff --git a/src/Migrate/Migrate.Autorest/Az.Migrate.format.ps1xml b/src/Migrate/Migrate.Autorest/Az.Migrate.format.ps1xml
index 7685de2c559b..d0cc17da37d6 100644
--- a/src/Migrate/Migrate.Autorest/Az.Migrate.format.ps1xml
+++ b/src/Migrate/Migrate.Autorest/Az.Migrate.format.ps1xml
@@ -23,9 +23,18 @@
+
+
+
+
+
+
+
+
+
@@ -38,6 +47,9 @@
+
+
+
@@ -62,6 +74,9 @@
+
+
+
@@ -71,6 +86,9 @@
+
+
+
@@ -86,6 +104,9 @@
+
+
+
@@ -107,6 +128,9 @@
+
+
+
@@ -135,9 +159,18 @@
DatabaseName
+
+ DeploymentId
+
+
+ EmailConfigurationName
+
EventName
+
+ FabricAgentName
+
FabricName
@@ -150,6 +183,9 @@
JobName
+
+ Location
+
LogicalNetworkName
@@ -174,6 +210,9 @@
NetworkName
+
+ OperationId
+
OperationStatusName
@@ -183,6 +222,9 @@
ProtectableItemName
+
+ ProtectedItemName
+
ProtectionContainerName
@@ -198,6 +240,9 @@
ReplicatedProtectedItemName
+
+ ReplicationExtensionName
+
ResourceGroupName
@@ -219,6 +264,9 @@
SubscriptionId
+
+ VaultName
+
VaultSettingName
@@ -233,6 +281,142 @@
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.ErrorDetail
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.ErrorDetail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.OperationAutoGenerated
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.OperationAutoGenerated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionType
+
+
+ IsDataAction
+
+
+ Name
+
+
+ Origin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.OperationDisplayAutoGenerated
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.OperationDisplayAutoGenerated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.OperationListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api40.OperationListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.A2AAddDisksInput
@@ -26523,5 +26707,4775 @@
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DiskFileFormat
+
+
+ DiskId
+
+
+ DiskSizeGb
+
+
+ IsDynamic
+
+
+ IsOSDisk
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NicId
+
+
+ TargetNetworkId
+
+
+ TestNetworkId
+
+
+ SelectionTypeForFailover
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHciClusterProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHciClusterProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ClusterName
+
+
+ ResourceName
+
+
+ StorageAccountName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHciFabricModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHciFabricModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ ApplianceName
+
+
+ AzStackHciSiteId
+
+
+ FabricContainerId
+
+
+ FabricResourceId
+
+
+ MigrationHubUri
+
+
+ MigrationSolutionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.CheckNameAvailabilityModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.CheckNameAvailabilityModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.CheckNameAvailabilityResponseModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.CheckNameAvailabilityResponseModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Message
+
+
+ NameAvailable
+
+
+ Reason
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DeploymentPreflightResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DeploymentPreflightResource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ApiVersion
+
+
+ Location
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CorrelationId
+
+
+ IsResponsive
+
+
+ LastHeartbeat
+
+
+ MachineId
+
+
+ MachineName
+
+
+ ProvisioningState
+
+
+ VersionNumber
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.DraModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CustomEmailAddress
+
+
+ Locale
+
+
+ SendToOwner
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EmailConfigurationModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ErrorModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ErrorModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Caus
+
+
+ Code
+
+
+ CreationTime
+
+
+ Message
+
+
+ Recommendation
+
+
+ Severity
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CorrelationId
+
+
+ Description
+
+
+ EventName
+
+
+ EventType
+
+
+ ResourceName
+
+
+ ResourceType
+
+
+ Severity
+
+
+ TimeOfOccurrence
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.EventModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Health
+
+
+ ProvisioningState
+
+
+ ServiceEndpoint
+
+
+ ServiceResourceId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelUpdate
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelUpdate
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelUpdateSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelUpdateSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelUpdateTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelUpdateTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FailoverProtectedItemProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FailoverProtectedItemProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NetworkName
+
+
+ ProtectedItemName
+
+
+ RecoveryPointId
+
+
+ RecoveryPointTime
+
+
+ Subnet
+
+
+ TestVMName
+
+
+ VMName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FailoverWorkflowModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FailoverWorkflowModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HealthErrorModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HealthErrorModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AffectedResourceCorrelationId
+
+
+ AffectedResourceType
+
+
+ Category
+
+
+ Caus
+
+
+ Code
+
+
+ CreationTime
+
+
+ HealthCategory
+
+
+ IsCustomerResolvable
+
+
+ Message
+
+
+ Recommendation
+
+
+ Severity
+
+
+ Source
+
+
+ Summary
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVMigrateFabricModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVMigrateFabricModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ FabricContainerId
+
+
+ FabricResourceId
+
+
+ HyperVSiteId
+
+
+ MigrationHubUri
+
+
+ MigrationSolutionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcidiskInput
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcidiskInput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DiskFileFormat
+
+
+ DiskId
+
+
+ DiskSizeGb
+
+
+ IsDynamic
+
+
+ IsOSDisk
+
+
+ StorageContainerId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcieventModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcieventModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ EventSourceFriendlyName
+
+
+ ProtectedItemFriendlyName
+
+
+ ServerType
+
+
+ SourceApplianceName
+
+
+ TargetApplianceName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcinicInput
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcinicInput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NetworkName
+
+
+ NicId
+
+
+ SelectionTypeForFailover
+
+
+ TargetNetworkId
+
+
+ TestNetworkId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciplannedFailoverModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciplannedFailoverModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ ShutdownSourceVM
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcipolicyModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcipolicyModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ AppConsistentFrequencyInMinute
+
+
+ CrashConsistentFrequencyInMinute
+
+
+ RecoveryPointHistoryInMinute
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciprotectedDiskProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciprotectedDiskProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CapacityInByte
+
+
+ DiskType
+
+
+ IsDynamic
+
+
+ IsOSDisk
+
+
+ MigrateDiskName
+
+
+ SeedDiskName
+
+
+ SourceDiskId
+
+
+ SourceDiskName
+
+
+ StorageContainerId
+
+
+ StorageContainerLocalPath
+
+
+ TestMigrateDiskName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciprotectedItemModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciprotectedItemModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ ActiveLocation
+
+
+ CustomLocationRegion
+
+
+ FabricDiscoveryMachineId
+
+
+ FailoverRecoveryPointId
+
+
+ FirmwareType
+
+
+ HyperVGeneration
+
+
+ InitialReplicationProgressPercentage
+
+
+ IsDynamicRam
+
+
+ LastRecoveryPointId
+
+
+ LastRecoveryPointReceived
+
+
+ LastReplicationUpdateTime
+
+
+ OSName
+
+
+ OSType
+
+
+ ResyncProgressPercentage
+
+
+ RunAsAccountId
+
+
+ SourceApplianceName
+
+
+ SourceCpuCore
+
+
+ SourceDraName
+
+
+ SourceMemoryInMegaByte
+
+
+ SourceVMName
+
+
+ StorageContainerId
+
+
+ TargetApplianceName
+
+
+ TargetArcClusterCustomLocationId
+
+
+ TargetAzStackHciClusterName
+
+
+ TargetCpuCore
+
+
+ TargetDraName
+
+
+ TargetHciClusterId
+
+
+ TargetLocation
+
+
+ TargetMemoryInMegaByte
+
+
+ TargetNetworkId
+
+
+ TargetResourceGroupId
+
+
+ TargetVMBiosId
+
+
+ TargetVMName
+
+
+ TestNetworkId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciprotectedNicProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciprotectedNicProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MacAddress
+
+
+ NetworkName
+
+
+ NicId
+
+
+ SelectionTypeForFailover
+
+
+ TargetNetworkId
+
+
+ TestNetworkId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcirecoveryPointModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcirecoveryPointModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ DiskId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcireplicationExtensionModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcireplicationExtensionModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ AsrServiceUri
+
+
+ AzStackHciFabricArmId
+
+
+ AzStackHciSiteId
+
+
+ GatewayServiceUri
+
+
+ HyperVFabricArmId
+
+
+ HyperVSiteId
+
+
+ RcmServiceUri
+
+
+ ResourceGroup
+
+
+ ResourceLocation
+
+
+ SourceGatewayServiceId
+
+
+ SourceStorageContainerName
+
+
+ StorageAccountId
+
+
+ StorageAccountSasSecretName
+
+
+ SubscriptionId
+
+
+ TargetGatewayServiceId
+
+
+ TargetStorageContainerName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IdentityModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IdentityModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AadAuthority
+
+
+ ApplicationId
+
+
+ Audience
+
+
+ ObjectId
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.InnerHealthErrorModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.InnerHealthErrorModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Category
+
+
+ Caus
+
+
+ Code
+
+
+ CreationTime
+
+
+ HealthCategory
+
+
+ IsCustomerResolvable
+
+
+ Message
+
+
+ Recommendation
+
+
+ Severity
+
+
+ Source
+
+
+ Summary
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsDataAction
+
+
+ Name
+
+
+ Origin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationStatusAutoGenerated
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.OperationStatusAutoGenerated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EndTime
+
+
+ Name
+
+
+ StartTime
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PlannedFailoverModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PlannedFailoverModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelProperties
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemDynamicMemoryConfig
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemDynamicMemoryConfig
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MaximumMemoryInMegaByte
+
+
+ MinimumMemoryInMegaByte
+
+
+ TargetMemoryBufferPercentage
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemJobProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemJobProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DisplayName
+
+
+ EndTime
+
+
+ Name
+
+
+ ScenarioName
+
+
+ StartTime
+
+
+ State
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AllowedJob
+
+
+ CorrelationId
+
+
+ DraId
+
+
+ FabricId
+
+
+ FabricObjectId
+
+
+ FabricObjectName
+
+
+ LastSuccessfulPlannedFailoverTime
+
+
+ LastSuccessfulTestFailoverTime
+
+
+ LastSuccessfulUnplannedFailoverTime
+
+
+ PolicyName
+
+
+ ProtectionState
+
+
+ ProtectionStateDescription
+
+
+ ProvisioningState
+
+
+ ReplicationExtensionName
+
+
+ ReplicationHealth
+
+
+ ResyncRequired
+
+
+ ResynchronizationState
+
+
+ SourceFabricProviderId
+
+
+ TargetDraId
+
+
+ TargetFabricId
+
+
+ TargetFabricProviderId
+
+
+ TestFailoverState
+
+
+ TestFailoverStateDescription
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesCurrentJob
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesCurrentJob
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DisplayName
+
+
+ EndTime
+
+
+ Name
+
+
+ ScenarioName
+
+
+ StartTime
+
+
+ State
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesLastFailedEnableProtectionJob
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesLastFailedEnableProtectionJob
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DisplayName
+
+
+ EndTime
+
+
+ Name
+
+
+ ScenarioName
+
+
+ StartTime
+
+
+ State
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesLastFailedPlannedFailoverJob
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesLastFailedPlannedFailoverJob
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DisplayName
+
+
+ EndTime
+
+
+ Name
+
+
+ ScenarioName
+
+
+ StartTime
+
+
+ State
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesLastTestFailoverJob
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelPropertiesLastTestFailoverJob
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DisplayName
+
+
+ EndTime
+
+
+ Name
+
+
+ ScenarioName
+
+
+ StartTime
+
+
+ State
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RecoveryPointTime
+
+
+ RecoveryPointType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.RecoveryPointModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelProperties
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.StorageContainerProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.StorageContainerProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ClusterSharedVolumePath
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.SystemDataModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.SystemDataModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TaskModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TaskModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EndTime
+
+
+ StartTime
+
+
+ State
+
+
+ TaskName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TaskModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TaskModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TestFailoverCleanupWorkflowModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TestFailoverCleanupWorkflowModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ Comment
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TestFailoverWorkflowModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.TestFailoverWorkflowModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+ ServiceResourceId
+
+
+ VaultType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelUpdate
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelUpdate
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelUpdateSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelUpdateSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelUpdateTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VaultModelUpdateTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareDraModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareDraModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ BiosId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareMigrateFabricModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareMigrateFabricModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ MigrationSolutionId
+
+
+ VmwareSiteId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcidiskInput
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcidiskInput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DiskFileFormat
+
+
+ DiskId
+
+
+ DiskSizeGb
+
+
+ IsDynamic
+
+
+ IsOSDisk
+
+
+ StorageContainerId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcinicInput
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcinicInput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Label
+
+
+ NetworkName
+
+
+ NicId
+
+
+ SelectionTypeForFailover
+
+
+ TargetNetworkId
+
+
+ TestNetworkId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciplannedFailoverModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciplannedFailoverModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ ShutdownSourceVM
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcipolicyModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcipolicyModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ AppConsistentFrequencyInMinute
+
+
+ CrashConsistentFrequencyInMinute
+
+
+ RecoveryPointHistoryInMinute
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciprotectedDiskProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciprotectedDiskProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CapacityInByte
+
+
+ DiskType
+
+
+ IsDynamic
+
+
+ IsOSDisk
+
+
+ MigrateDiskName
+
+
+ SeedDiskName
+
+
+ SourceDiskId
+
+
+ SourceDiskName
+
+
+ StorageContainerId
+
+
+ StorageContainerLocalPath
+
+
+ TestMigrateDiskName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciprotectedItemModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciprotectedItemModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ ActiveLocation
+
+
+ CustomLocationRegion
+
+
+ FabricDiscoveryMachineId
+
+
+ FailoverRecoveryPointId
+
+
+ FirmwareType
+
+
+ HyperVGeneration
+
+
+ InitialReplicationProgressPercentage
+
+
+ IsDynamicRam
+
+
+ LastRecoveryPointId
+
+
+ LastRecoveryPointReceived
+
+
+ LastReplicationUpdateTime
+
+
+ MigrationProgressPercentage
+
+
+ OSName
+
+
+ OSType
+
+
+ PerformAutoResync
+
+
+ ResumeProgressPercentage
+
+
+ ResumeRetryCount
+
+
+ ResyncProgressPercentage
+
+
+ ResyncRequired
+
+
+ ResyncRetryCount
+
+
+ ResyncState
+
+
+ RunAsAccountId
+
+
+ SourceApplianceName
+
+
+ SourceCpuCore
+
+
+ SourceDraName
+
+
+ SourceMemoryInMegaByte
+
+
+ SourceVMName
+
+
+ StorageContainerId
+
+
+ TargetApplianceName
+
+
+ TargetArcClusterCustomLocationId
+
+
+ TargetAzStackHciClusterName
+
+
+ TargetCpuCore
+
+
+ TargetDraName
+
+
+ TargetHciClusterId
+
+
+ TargetLocation
+
+
+ TargetMemoryInMegaByte
+
+
+ TargetNetworkId
+
+
+ TargetResourceGroupId
+
+
+ TargetVMBiosId
+
+
+ TargetVMName
+
+
+ TestNetworkId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciprotectedNicProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciprotectedNicProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsPrimaryNic
+
+
+ Label
+
+
+ MacAddress
+
+
+ NetworkName
+
+
+ NicId
+
+
+ SelectionTypeForFailover
+
+
+ TargetNetworkId
+
+
+ TestNetworkId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcireplicationExtensionModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcireplicationExtensionModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+ AsrServiceUri
+
+
+ AzStackHciFabricArmId
+
+
+ AzStackHciSiteId
+
+
+ GatewayServiceUri
+
+
+ RcmServiceUri
+
+
+ ResourceGroup
+
+
+ ResourceLocation
+
+
+ SourceGatewayServiceId
+
+
+ SourceStorageContainerName
+
+
+ StorageAccountId
+
+
+ StorageAccountSasSecretName
+
+
+ SubscriptionId
+
+
+ TargetGatewayServiceId
+
+
+ TargetStorageContainerName
+
+
+ VmwareFabricArmId
+
+
+ VmwareSiteId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModel
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModel
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCollection
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCollection
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomProperties
+
+
+
+
+
+
+
+
+
+
+
+ InstanceType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActivityId
+
+
+ AllowedAction
+
+
+ DisplayName
+
+
+ EndTime
+
+
+ ObjectId
+
+
+ ObjectInternalId
+
+
+ ObjectInternalName
+
+
+ ObjectName
+
+
+ ObjectType
+
+
+ ReplicationProviderId
+
+
+ SourceFabricProviderId
+
+
+ StartTime
+
+
+ State
+
+
+ TargetFabricProviderId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelSystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelSystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/Az.Migrate.psd1 b/src/Migrate/Migrate.Autorest/Az.Migrate.psd1
index 125055facfec..7f8413274072 100644
--- a/src/Migrate/Migrate.Autorest/Az.Migrate.psd1
+++ b/src/Migrate/Migrate.Autorest/Az.Migrate.psd1
@@ -1,154 +1,24 @@
-#
-# Module manifest for module 'Az.Migrate'
-#
-# Generated by: Microsoft Corporation
-#
-# Generated on: 06/29/2023
-#
-
@{
-
-# Script module or binary module file associated with this manifest.
-RootModule = './Az.Migrate.psm1'
-
-# Version number of this module.
-ModuleVersion = '2.2.0'
-
-# Supported PSEditions
-CompatiblePSEditions = 'Core', 'Desktop'
-
-# ID used to uniquely identify this module
-GUID = 'c638312b-9fd1-4611-a5cc-11a8caa5b698'
-
-# Author of this module
-Author = 'Microsoft Corporation'
-
-# Company or vendor of this module
-CompanyName = 'Microsoft Corporation'
-
-# Copyright statement for this module
-Copyright = 'Microsoft Corporation. All rights reserved.'
-
-# Description of the functionality provided by this module
-Description = 'Microsoft Azure PowerShell: Migrate cmdlets'
-
-# Minimum version of the PowerShell engine required by this module
-PowerShellVersion = '5.1'
-
-# Name of the PowerShell host required by this module
-# PowerShellHostName = ''
-
-# Minimum version of the PowerShell host required by this module
-# PowerShellHostVersion = ''
-
-# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
-DotNetFrameworkVersion = '4.7.2'
-
-# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
-# ClrVersion = ''
-
-# Processor architecture (None, X86, Amd64) required by this module
-# ProcessorArchitecture = ''
-
-# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.12.4'; })
-
-# Assemblies that must be loaded prior to importing this module
-RequiredAssemblies = './bin/Az.Migrate.private.dll'
-
-# Script files (.ps1) that are run in the caller's environment prior to importing this module.
-# ScriptsToProcess = @()
-
-# Type files (.ps1xml) to be loaded when importing this module
-# TypesToProcess = @()
-
-# Format files (.ps1xml) to be loaded when importing this module
-FormatsToProcess = './Az.Migrate.format.ps1xml'
-
-# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
-# NestedModules = @()
-
-# 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.
-FunctionsToExport = 'Get-AzMigrateDiscoveredServer', 'Get-AzMigrateJob',
- 'Get-AzMigrateProject', 'Get-AzMigrateReplicationFabric',
- 'Get-AzMigrateReplicationPolicy',
- 'Get-AzMigrateReplicationProtectionContainer',
- 'Get-AzMigrateReplicationProtectionContainerMapping',
- 'Get-AzMigrateReplicationRecoveryServicesProvider',
- 'Get-AzMigrateRunAsAccount', 'Get-AzMigrateServerReplication',
- 'Get-AzMigrateSite', 'Get-AzMigrateSolution',
- 'Initialize-AzMigrateReplicationInfrastructure',
- 'New-AzMigrateDiskMapping', 'New-AzMigrateNicMapping',
- 'New-AzMigrateProject', 'New-AzMigrateReplicationPolicy',
- 'New-AzMigrateReplicationProtectionContainerMapping',
- 'New-AzMigrateServerReplication', 'New-AzMigrateTestNicMapping',
- 'Register-AzMigrateProjectTool', 'Remove-AzMigrateProject',
- 'Remove-AzMigrateServerReplication',
- 'Restart-AzMigrateServerReplication',
- 'Resume-AzMigrateServerReplication', 'Set-AzMigrateDiskMapping',
- 'Set-AzMigrateServerReplication', 'Start-AzMigrateServerMigration',
- 'Start-AzMigrateTestMigration',
- 'Start-AzMigrateTestMigrationCleanup',
- 'Suspend-AzMigrateServerReplication'
-
-# 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.
-CmdletsToExport = @()
-
-# Variables to export from this module
-# VariablesToExport = @()
-
-# 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.
-AliasesToExport = '*'
-
-# DSC resources to export from this module
-# DscResourcesToExport = @()
-
-# List of all modules packaged with this module
-# ModuleList = @()
-
-# List of all files packaged with this module
-# FileList = @()
-
-# 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.
-PrivateData = @{
-
+ GUID = 'c638312b-9fd1-4611-a5cc-11a8caa5b698'
+ RootModule = './Az.Migrate.psm1'
+ ModuleVersion = '1.0.1'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: Migrate cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.Migrate.private.dll'
+ FormatsToProcess = './Az.Migrate.format.ps1xml'
+ FunctionsToExport = 'Get-AzMigrateDiscoveredServer', 'Get-AzMigrateHCIJob', 'Get-AzMigrateHCIReplicationFabric', 'Get-AzMigrateHCIServerReplication', 'Get-AzMigrateJob', 'Get-AzMigrateProject', 'Get-AzMigrateReplicationFabric', 'Get-AzMigrateReplicationPolicy', 'Get-AzMigrateReplicationProtectionContainer', 'Get-AzMigrateReplicationProtectionContainerMapping', 'Get-AzMigrateReplicationRecoveryServicesProvider', 'Get-AzMigrateRunAsAccount', 'Get-AzMigrateServerReplication', 'Get-AzMigrateSite', 'Get-AzMigrateSolution', 'Initialize-AzMigrateHCIReplicationInfrastructure', 'Initialize-AzMigrateReplicationInfrastructure', 'New-AzMigrateDiskMapping', 'New-AzMigrateHCIDiskMappingObject', 'New-AzMigrateHCINicMappingObject', 'New-AzMigrateHCIServerReplication', 'New-AzMigrateNicMapping', 'New-AzMigrateProject', 'New-AzMigrateReplicationPolicy', 'New-AzMigrateReplicationProtectionContainerMapping', 'New-AzMigrateServerReplication', 'New-AzMigrateTestNicMapping', 'Register-AzMigrateProjectTool', 'Remove-AzMigrateHCIServerReplication', 'Remove-AzMigrateProject', 'Remove-AzMigrateServerReplication', 'Restart-AzMigrateServerReplication', 'Resume-AzMigrateServerReplication', 'Set-AzMigrateDiskMapping', 'Set-AzMigrateHCIServerReplication', 'Set-AzMigrateServerReplication', 'Start-AzMigrateHCIServerMigration', 'Start-AzMigrateServerMigration', 'Start-AzMigrateTestMigration', 'Start-AzMigrateTestMigrationCleanup', 'Suspend-AzMigrateServerReplication', '*'
+ AliasesToExport = '*'
+ PrivateData = @{
PSData = @{
-
- # Tags applied to this module. These help with module discovery in online galleries.
- Tags = 'Azure','ResourceManager','ARM','PSModule','Migrate'
-
- # A URL to the license for this module.
- LicenseUri = 'https://aka.ms/azps-license'
-
- # A URL to the main website for this project.
- ProjectUri = 'https://github.com/Azure/azure-powershell'
-
- # A URL to an icon representing this module.
- # IconUri = ''
-
- # ReleaseNotes of this module
- ReleaseNotes = '* Fixed key vault SPN Id coming as null for some users
-* Added support for Windows Server OS upgrade while migrating the server to Azure using Azure Migrate
-* Updated OsUpgradeVersion parameter for Azure Migrate'
-
- # Prerelease string of this module
- # Prerelease = ''
-
- # Flag to indicate whether the module requires explicit user acceptance for install/update/save
- # RequireLicenseAcceptance = $false
-
- # External dependent modules of this module
- # ExternalModuleDependencies = @()
-
- } # End of PSData hashtable
-
- } # End of PrivateData hashtable
-
-# HelpInfo URI of this module
-# HelpInfoURI = ''
-
-# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
-# DefaultCommandPrefix = ''
-
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Migrate'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
}
-
diff --git a/src/Migrate/Migrate.Autorest/README.md b/src/Migrate/Migrate.Autorest/README.md
index 749da2c821fb..8a9dd79f6d53 100644
--- a/src/Migrate/Migrate.Autorest/README.md
+++ b/src/Migrate/Migrate.Autorest/README.md
@@ -48,17 +48,22 @@ In this directory, run AutoRest:
``` yaml
skip-semantics-validation: true
+commit: 0dd49a444195fef7f3555cad038cb7665cbd928c
require:
- - $(this-folder)/../readme.azure.noprofile.md
+ - $(this-folder)/../../readme.azure.noprofile.md
input-file:
- - $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json
- - $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
- - $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/service.json
+ - $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json
+ - $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
+ - $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/service.json
+ - $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
module-version: 1.0.1
title: Migrate
subject-prefix: 'Migrate'
+use-extension:
+ "@autorest/powershell": "3.x"
+
directive:
# Correct some swagger operationIds
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
@@ -101,6 +106,22 @@ directive:
- ProtectionContainerMappingProviderSpecificDetails
- MigrateProjectProperties
- FabricProperties
+ - FabricModelProperties
+ - FabricModelCustomProperties
+ - AzStackHCIFabricModelCustomProperties
+ - HyperVMigrateFabricModelCustomProperties
+ - VMwareMigrateFabricModelCustomProperties
+ - PolicyModelProperties
+ - ReplicationExtensionModelProperties
+ - ProtectedItemModelProperties
+ - ProtectedItemModelCustomProperties
+ - HyperVToAzStackHCIProtectedItemModelCustomProperties
+ - VMwareToAzStackHCIProtectedItemModelCustomProperties
+ - PlannedFailoverModelProperties
+ - WorkflowModelProperties
+ - WorkflowModelCustomProperties
+ - TaskModel
+ - TaskModelCustomProperties
# Remove variants not in scope
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
@@ -220,10 +241,6 @@ directive:
verb: New$|Remove$|Update$
subject: ^Site
remove: true
- - from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
- where:
- subject: ^HyperV
- remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
subject: ^Job|^VMwareOperationsStatus
@@ -240,7 +257,12 @@ directive:
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
verb: Set$|Remove$|Update$
- subject: ^Solution|ProjectSummary$
+ subject: ProjectSummary$
+ remove: true
+ - from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
+ where:
+ verb: Remove$|Update$
+ subject: ^Solution
remove: true
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
@@ -257,7 +279,7 @@ directive:
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
- subject: ^Commit|^Planned|^Renew|^Reprotect|^Unplanned|VaultHealth$|ComputeSize$|FabricConsistency$
+ subject: ^Commit|^Renew|^Reprotect|^Unplanned|VaultHealth$|ComputeSize$|FabricConsistency$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
@@ -294,7 +316,74 @@ directive:
verb: New
subject: ^ReplicationVaultSetting|^SupportedOperatingSystem|^ReplicationProtectionIntent
remove: true
+ - from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
+ where:
+ verb: Get
+ subject: ^HyperV(Cluster|Host|Job|OperationsStatus)$
+ remove: true
+ - from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
+ where:
+ verb: Set
+ subject: ^HyperV(Cluster|Host)$
+ remove: true
+ - from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
+ where:
+ verb: New|Remove|Update
+ subject: ^HyperV
+ remove: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Test|Invoke
+ subject: NameAvailability$|DeploymentPreflight
+ remove: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Get|New
+ subject: ^EmailConfiguration
+ remove: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Get
+ subject: ^(Dra|ProtectedItem|Vault|Workflow)OperationStatus$
+ remove: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Get
+ subject: ^FabricOperationsStatus$
+ remove: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: New
+ subject: ^(Dra|Vault)
+ remove: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Update
+ subject: ^Vault
+ remove: true
+ - from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
+ where:
+ verb: Invoke
+ subject: ^PlannedReplication
+ remove: true
+ # Rename cmdlets for AzStackHCI
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Get
+ subject: ^Fabric$
+ set:
+ subject: HCIReplicationFabric
# Hide cmldets used by custom
+ - from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
+ where:
+ verb: Set$
+ subject: ^Solution
+ hide: true
+ - from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
+ where:
+ verb: Get$
+ subject: ToAzureMigrate$
+ hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
verb: Get$
@@ -340,6 +429,15 @@ directive:
verb: Resume$
subject: ^ReplicationMigrationItemReplication
hide: true
+ - from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
+ where:
+ subject: ^Planned
+ hide: true
+ - from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
+ where:
+ verb: Get
+ subject: ^HyperV(Site|RunAsAccount)$
+ hide: true
# Hide cmdlets not to be visible to user.
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
@@ -369,6 +467,11 @@ directive:
verb: New$
variant: ^CreateViaIdentity
hide: true
+ - from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
+ where:
+ verb: Get$|Invoke$|New$|Remove$|Test$|Update$
+ subject: ^Dra|^Fabric|^Policy|^EmailConfiguration|^ProtectedItem|^ReplicationExtension|^Vault|^Workflow
+ hide: true
- where:
verb: New$|Set$|Update$
subject: Site$|VCenter$
diff --git a/src/Migrate/Migrate.Autorest/UX/Microsoft.DataReplication/replicationFabrics.json b/src/Migrate/Migrate.Autorest/UX/Microsoft.DataReplication/replicationFabrics.json
new file mode 100644
index 000000000000..9d3d7946fb94
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/UX/Microsoft.DataReplication/replicationFabrics.json
@@ -0,0 +1,47 @@
+{
+ "resourceType": "replicationFabrics",
+ "apiVersion": "2021-02-16-preview",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.migrate"
+ },
+ "commands": [
+ {
+ "name": "Get-AzMigrateHCIReplicationFabric",
+ "description": "Gets the details of the fabric.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcireplicationfabric"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Gets the details of the fabric.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.fabricName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/Migrate/Migrate.Autorest/build-module.ps1 b/src/Migrate/Migrate.Autorest/build-module.ps1
index 737a58e36efb..8a247d557ab3 100644
--- a/src/Migrate/Migrate.Autorest/build-module.ps1
+++ b/src/Migrate/Migrate.Autorest/build-module.ps1
@@ -143,7 +143,8 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
- Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}
Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
@@ -162,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
Write-Host -ForegroundColor Green 'Creating example stubs...'
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
+{
+ Write-Host -ForegroundColor Green 'Creating ux metadata...'
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+}
+
Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/Migrate/Migrate.Autorest/custom/AzStackHCIDiskInput.cs b/src/Migrate/Migrate.Autorest/custom/AzStackHCIDiskInput.cs
new file mode 100644
index 000000000000..779629268edc
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/AzStackHCIDiskInput.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview
+{
+ public class AzStackHCIDiskInput
+ {
+ public AzStackHCIDiskInput(
+ string diskId,
+ bool isDynamic,
+ long diskSizeGB,
+ string diskFileFormat,
+ bool isOsDisk)
+ {
+ DiskId = diskId;
+ IsDynamic = isDynamic;
+ DiskSizeGb = diskSizeGB;
+ DiskFileFormat = diskFileFormat;
+ IsOSDisk = isOsDisk;
+ }
+
+ /// Gets or sets the type of the virtual hard disk, vhd or vhdx.
+ public string DiskFileFormat { get; set; }
+
+ /// Gets or sets the disk Id.
+ public string DiskId { get; set; }
+
+ /// Gets or sets the disk size in GB.
+ public long DiskSizeGb { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard
+ /// disk.
+ ///
+ public bool? IsDynamic { get; set; }
+
+ /// Gets or sets a value indicating whether disk is os disk.
+ public bool IsOSDisk { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/AzStackHCINicInput.cs b/src/Migrate/Migrate.Autorest/custom/AzStackHCINicInput.cs
new file mode 100644
index 000000000000..44929f7ddf97
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/AzStackHCINicInput.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview
+{
+ public class AzStackHCINicInput
+ {
+ public AzStackHCINicInput(
+ string nicId,
+ string targetNetworkId,
+ string testNetworkId,
+ string selectionTypeForFailover)
+ {
+ NicId = nicId;
+ TargetNetworkId = targetNetworkId;
+ TestNetworkId = testNetworkId;
+ SelectionTypeForFailover = selectionTypeForFailover;
+ }
+
+ /// Gets or sets the NIC Id.
+ public string NicId { get; set; }
+
+ /// Gets or sets the target network Id within AzStackHCI Cluster.
+ public string TargetNetworkId { get; set; }
+
+ /// Gets or sets the target test network Id within AzStackHCI Cluster.
+ public string TestNetworkId { get; set; }
+
+ /// Gets or sets the selection type of the NIC.
+ public string SelectionTypeForFailover { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateDiscoveredServer.ps1 b/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateDiscoveredServer.ps1
index 1dd26a2c2cf7..e0cb94cc8db0 100644
--- a/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateDiscoveredServer.ps1
+++ b/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateDiscoveredServer.ps1
@@ -23,8 +23,10 @@ https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratediscovered
#>
function Get-AzMigrateDiscoveredServer {
- [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine])]
- [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ [OutputType(
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine],
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IHyperVMachine])]
+ [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param (
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
@@ -38,30 +40,38 @@ function Get-AzMigrateDiscoveredServer {
# Specifies the resource group name.
${ResourceGroupName},
- [Parameter(ParameterSetName='Get', Mandatory)]
- [Parameter(ParameterSetName='GetInSite', Mandatory)]
+ [Parameter(ParameterSetName = 'Get', Mandatory)]
+ [Parameter(ParameterSetName = 'GetInSite', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the VMware machine name. This is an internal Name. For users, use display name.
+ # Specifies the source machine name. This is an internal Name. For users, use display name.
${Name},
- [Parameter(ParameterSetName='List')]
- [Parameter(ParameterSetName='ListInSite')]
+ [Parameter(ParameterSetName = 'List')]
+ [Parameter(ParameterSetName = 'ListInSite')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the VMware machine display name.
+ # Specifies the source machine display name.
${DisplayName},
- [Parameter(ParameterSetName='GetInSite', Mandatory)]
- [Parameter(ParameterSetName='ListInSite', Mandatory)]
+ [Parameter(ParameterSetName = 'GetInSite', Mandatory)]
+ [Parameter(ParameterSetName = 'ListInSite', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
# Specifies the appliance name. This internally maps to a site.
${ApplianceName},
[Parameter()]
+ [ValidateSet("VMware", "HyperV")]
+ [ArgumentCompleter( { "VMware", "HyperV" })]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
- [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Specifies the source machine type. Currently, only HyperV and VMware are supported.
+ ${SourceMachineType} = "VMware",
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
[System.String[]]
# Specifies the subscription id.
${SubscriptionId}
@@ -69,117 +79,159 @@ function Get-AzMigrateDiscoveredServer {
process {
$parameterSet = $PSCmdlet.ParameterSetName
+ $hasApplianceName = $PSBoundParameters.ContainsKey("ApplianceName")
$discoverySolutionName = "Servers-Discovery-ServerDiscovery"
- $discoverySolution = Get-AzMigrateSolution -SubscriptionId $SubscriptionId -ResourceGroupName $ResourceGroupName -MigrateProjectName $ProjectName -Name $discoverySolutionName
- if ($discoverySolution.Name -ne $discoverySolutionName) {
+ $discoverySolution = Az.Migrate\Get-AzMigrateSolution -SubscriptionId $SubscriptionId -ResourceGroupName $ResourceGroupName -MigrateProjectName $ProjectName -Name $discoverySolutionName
+ if ($discoverySolution.Name -ne $discoverySolutionName)
+ {
throw "Server Discovery Solution not found."
}
$appMap = @{}
- if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"]) {
+ if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"])
+ {
$appMapV2 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] | ConvertFrom-Json
# Fetch all appliance from V2 map first. Then these can be updated if found again in V3 map.
- foreach ($item in $appMapV2) {
+ foreach ($item in $appMapV2)
+ {
$appMap[$item.ApplianceName] = $item.SiteId
}
}
- if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"]) {
+ if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"])
+ {
$appMapV3 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] | ConvertFrom-Json
- foreach ($item in $appMapV3) {
+ foreach ($item in $appMapV3)
+ {
$t = $item.psobject.properties
$appMap[$t.Name] = $t.Value.SiteId
}
}
if ($null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] -And
- $null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] ) {
+ $null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] )
+ {
throw "Server Discovery Solution missing Appliance Details. Invalid Solution."
}
# Regex to match site name.
- $r = '(?<=/Microsoft.OffAzure/VMwareSites/).*$'
- $siteNameTmp = ""
- if ($parameterSet -match "Site") {
- #Fetch by site scenario. This is when site name filter is provided.
- $siteFound = 0
- foreach ($kvp in $appMap.GetEnumerator()) {
- if ($kvp.Key -eq $ApplianceName) {
- $siteArmId = $kvp.Value
- if ($siteArmId -match $r) {
- $siteNameTmp = $Matches[0]
- $siteFound = 1
- if ($parameterSet -eq 'GetInSite') {
- return Get-AzMigrateMachine -Name $Name -ResourceGroupName $ResourceGroupName -SiteName $siteNameTmp -SubscriptionId $SubscriptionId
- }
- elseif ($parameterSet -eq 'ListInSite') {
- $siteMachines = Get-AzMigrateMachine -ResourceGroupName $ResourceGroupName -SiteName $siteNameTmp -SubscriptionId $SubscriptionId
-
- if ($DisplayName) {
- $filteredMachines = $siteMachines | Where-Object {$_.DisplayName -match $DisplayName}
- return $filteredMachines
- }
- else {
- return $siteMachines
- }
- }
- }
+ if ($SourceMachineType -eq "VMware")
+ {
+ $siteRegex = "(?<=/Microsoft.OffAzure/VMwareSites/).*$"
+ }
+ else {
+ $siteRegex = "(?<=/Microsoft.OffAzure/HyperVSites/).*$"
+ }
+
+ if ($parameterSet -match 'Get')
+ {
+ # Get or GetInSite
+ foreach ($kvp in $appMap.GetEnumerator())
+ {
+ if (($kvp.Value -match $siteRegex) -and
+ (-not (($parameterSet -eq 'GetInSite') -and ($kvp.Key -ne $ApplianceName))))
+ {
+ $siteNameTmp = $Matches[0]
+ if ($SourceMachineType -eq "VMware")
+ {
+ $machine = Az.Migrate.Internal\Get-AzMigrateMachine `
+ -Name $Name `
+ -ResourceGroupName $ResourceGroupName `
+ -SiteName $siteNameTmp `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ }
+ else {
+ # HyperV
+ $machine = Az.Migrate.Internal\Get-AzMigrateHyperVMachine `
+ -MachineName $Name `
+ -ResourceGroupName $ResourceGroupName `
+ -SiteName $siteNameTmp `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ }
+
+ # Remove server marked as Deleted.
+ if ($null -ne $machine -and $machine.IsDeleted)
+ {
+ $machine = $null
+ }
+
+ if ($null -ne $machine)
+ {
+ return $machine
+ }
}
}
- if ($siteFound -eq 0) {
- throw "Appiance: $ApplianceName not found in project $ProjectName."
+ $errorMsg = "No machine with machine Name '$Name' of Type '$SourceMachineType' found in Project '$ProjectName'"
+ if ($hasApplianceName)
+ {
+ $errorMsg += " with Appliance '$ApplianceName'"
}
+
+ throw $errorMsg
}
else {
- # Fetch across project. All machines or by name.
- $projectSdsMachines = [System.Collections.ArrayList]::new()
+ # List or ListInSite
+ $allMachines = [System.Collections.ArrayList]::new()
+ foreach ($kvp in $appMap.GetEnumerator())
+ {
+ if (($kvp.Value -match $siteRegex) -and
+ (-not (($parameterSet -eq 'ListInSite') -and ($kvp.Key -ne $ApplianceName))))
+ {
+ $siteNameTmp = $Matches[0]
+ if ($SourceMachineType -eq "VMware")
+ {
+ $machines = Az.Migrate.Internal\Get-AzMigrateMachine `
+ -ResourceGroupName $ResourceGroupName `
+ -SiteName $siteNameTmp `
+ -SubscriptionId $SubscriptionId
+ }
+ else {
+ # HyperV
+ $machines = Az.Migrate.Internal\Get-AzMigrateHyperVMachine `
+ -ResourceGroupName $ResourceGroupName `
+ -SiteName $siteNameTmp `
+ -SubscriptionId $SubscriptionId
+ }
- if ($parameterSet -eq 'List') {
- foreach ($kvp in $appMap.GetEnumerator()) {
- $siteArmId = $kvp.Value
-
- if ($siteArmId -match $r) {
- $siteNameTmp = $Matches[0]
- $siteMachines = Get-AzMigrateMachine -ResourceGroupName $ResourceGroupName -SiteName $siteNameTmp -SubscriptionId $SubscriptionId
- if ($null -ne $siteMachines) {
- $projectSdsMachines.AddRange($siteMachines)
- }
+ if ($null -ne $machines)
+ {
+ $allMachines.AddRange($machines)
}
}
+ }
- if ($DisplayName) {
- $filteredMachines = $projectSdsMachines | Where-Object {$_.DisplayName -match $DisplayName}
- return $filteredMachines
- }
- else {
- return $projectSdsMachines
- }
+ # Remove servers marked as Deleted.
+ $allMachines = $allMachines | Where-Object { !$_.IsDeleted }
+
+ if ($allMachines.Count -gt 0 -and $DisplayName)
+ {
+ $allMachines = $allMachines | Where-Object { $_.DisplayName -match $DisplayName }
}
- elseif ($parameterSet -eq 'Get') {
- foreach ($kvp in $appMap.GetEnumerator()) {
- $siteArmId = $kvp.Value
-
- if ($siteArmId -match $r) {
- $siteNameTmp = $Matches[0]
-
- try {
- $siteMachine = Get-AzMigrateMachine -Name $Name -ResourceGroupName $ResourceGroupName -SiteName $siteNameTmp -SubscriptionId $SubscriptionId
- if ($null -ne $siteMachine) {
- return $siteMachine
- }
- }
- catch {
- $theError = $_
- Write-Host $theError
- }
- }
+
+ if ($allMachines.Count -eq 0)
+ {
+ $errorMsg = "No machine of Type '$SourceMachineType' found in Project '$ProjectName'"
+ if ($hasApplianceName)
+ {
+ $errorMsg += " with Appliance '$ApplianceName'"
+ }
+
+ if ($DisplayName)
+ {
+ $errorMsg += " with matching machine DisplayName '$DisplayName'"
}
- throw "Machine with Id $Name not found in project $ProjectName."
+ throw $errorMsg
}
+
+ return $allMachines
}
}
}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIJob.ps1 b/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIJob.ps1
new file mode 100644
index 000000000000..f360c51a956e
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIJob.ps1
@@ -0,0 +1,188 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Retrieves the status of an Azure Migrate job.
+.Description
+The Get-AzMigrateHCIJob cmdlet retrives the status of an Azure Migrate job.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcijob
+#>
+function Get-AzMigrateHCIJob {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+ [CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
+ param(
+ [Parameter(ParameterSetName = 'GetById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the job id for which the details needs to be retrieved.
+ ${ID},
+
+ [Parameter(ParameterSetName = 'GetByName', Mandatory)]
+ [Parameter(ParameterSetName = 'ListByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The name of the resource group where the recovery services vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName = 'GetByName', Mandatory)]
+ [Parameter(ParameterSetName = 'ListByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The name of the migrate project.
+ ${ProjectName},
+
+ [Parameter(ParameterSetName = 'GetByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Job identifier
+ ${Name},
+
+ [Parameter(ParameterSetName = 'GetByInputObject', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Specifies the job object of the replicating server.
+ ${InputObject},
+
+ [Parameter(ParameterSetName = 'ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupID},
+
+ [Parameter(ParameterSetName = 'ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Azure Migrate Project in which servers are replicating.
+ ${ProjectID},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $null = $PSBoundParameters.Remove('ID')
+ $null = $PSBoundParameters.Remove('ResourceGroupName')
+ $null = $PSBoundParameters.Remove('ProjectName')
+ $null = $PSBoundParameters.Remove('Name')
+ $null = $PSBoundParameters.Remove('InputObject')
+ $null = $PSBoundParameters.Remove('ResourceGroupID')
+ $null = $PSBoundParameters.Remove('ProjectID')
+
+ if (($parameterSet -match 'Name') -or ($parameterSet -eq 'ListById')) {
+ if ($parameterSet -eq 'ListById') {
+ $ProjectIdArray = $ProjectID.Split("/")
+ if ($ProjectIdArray.Length -lt 9) {
+ throw "Invalid Project ID '$ProjectID'"
+ }
+ $ProjectName = $ProjectIdArray[8]
+ $ResourceGroupName = $ResourceGroupID.Split("/")[4]
+ }
+ $null = $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $null = $PSBoundParameters.Add("Name", "Servers-Migration-ServerMigration_DataReplication")
+ $null = $PSBoundParameters.Add("MigrateProjectName", $ProjectName)
+
+ $solution = Az.Migrate\Get-AzMigrateSolution @PSBoundParameters
+ if ($solution -and ($solution.Count -ge 1)) {
+ $vaultId = $solution.DetailExtendedDetail["vaultId"]
+ $vaultIdArray = $vaultId.Split("/")
+ if ($vaultIdArray.Length -lt 9) {
+ throw "Invalid Vault ID '$vaultId'"
+ }
+ $vaultName = $vaultIdArray[8]
+ }
+ else {
+ throw "Solution not found."
+ }
+
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("MigrateProjectName")
+ }
+ else {
+ if ($parameterSet -eq 'GetByInputObject') {
+ $ID = $InputObject.Id
+ }
+ $jobIdArray = $ID.split('/')
+ if ($jobIdArray.Length -lt 11) {
+ throw "Invalid Job ID '$ID'"
+ }
+ $ResourceGroupName = $jobIdArray[4]
+ $vaultName = $jobIdArray[8]
+ $Name = $jobIdArray[10]
+ }
+
+ $null = $PSBoundParameters.Add('ResourceGroupName', $ResourceGroupName)
+ $null = $PSBoundParameters.Add('VaultName', $vaultName)
+ if ($parameterSet -match 'Get') {
+ $null = $PSBoundParameters.Add('JobName', $Name)
+ }
+
+ return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIServerReplication.ps1 b/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIServerReplication.ps1
new file mode 100644
index 000000000000..25a19d1ba311
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Get-AzMigrateHCIServerReplication.ps1
@@ -0,0 +1,280 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Retrieves the details of the replicating server.
+.Description
+The Get-AzMigrateHCIServerReplication cmdlet retrieves the object for the replicating server.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehciserverreplication
+#>
+function Get-AzMigrateHCIServerReplication {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IProtectedItemModel])]
+ [CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
+ param(
+ [Parameter(ParameterSetName = 'GetByItemID', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the replicating server ARM ID.
+ ${TargetObjectID},
+
+ [Parameter(ParameterSetName = 'ListByName', Mandatory)]
+ [Parameter(ParameterSetName = 'GetByMachineName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName = 'ListByName', Mandatory)]
+ [Parameter(ParameterSetName = 'GetByMachineName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Azure Migrate project in the current subscription.
+ ${ProjectName},
+
+ [Parameter(ParameterSetName = 'GetBySDSID', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the machine ID of the discovered server.
+ ${DiscoveredMachineId},
+
+ [Parameter(ParameterSetName = 'GetByInputObject', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Specifies the machine object of the replicating server.
+ ${InputObject},
+
+ [Parameter(ParameterSetName = 'ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupID},
+
+ [Parameter(ParameterSetName = 'ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Azure Migrate Project in which servers are replicating.
+ ${ProjectID},
+
+ [Parameter(ParameterSetName = 'GetByMachineName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the display name of the replicating machine.
+ ${MachineName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
+
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $null = $PSBoundParameters.Remove('TargetObjectID')
+ $null = $PSBoundParameters.Remove('ResourceGroupName')
+ $null = $PSBoundParameters.Remove('ProjectName')
+ $null = $PSBoundParameters.Remove('DiscoveredMachineId')
+ $null = $PSBoundParameters.Remove('InputObject')
+ $null = $PSBoundParameters.Remove('ResourceGroupID')
+ $null = $PSBoundParameters.Remove('ProjectID')
+ $null = $PSBoundParameters.Remove('MachineName')
+
+ if ($parameterSet -eq 'GetBySDSID') {
+ $machineIdArray = $DiscoveredMachineId.Split("/")
+ if ($machineIdArray.Length -lt 11) {
+ throw "Invalid machine ID '$DiscoveredMachineId'"
+ }
+ $siteType = $machineIdArray[7]
+ $siteName = $machineIdArray[8]
+ $ResourceGroupName = $machineIdArray[4]
+ $ProtectedItemName = $machineIdArray[10]
+
+ $null = $PSBoundParameters.Add('ResourceGroupName', $ResourceGroupName)
+ $null = $PSBoundParameters.Add('SiteName', $siteName)
+
+ if (($siteType -ne $SiteTypes.HyperVSites) -and ($siteType -ne $SiteTypes.VMwareSites)) {
+ throw "Unknown machine site '$siteName' with Type '$siteType'."
+ }
+
+ # Occasionally, Get Machine Site will not return machine site even when the site exist,
+ # hence retry get machine site.
+ $attempts = 4
+ for ($i = 1; $i -le $attempts; $i++) {
+ try {
+ if ($siteType -eq $SiteTypes.VMwareSites) {
+ $siteObject = Az.Migrate\Get-AzMigrateSite @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ }
+ elseif ($siteType -eq $SiteTypes.HyperVSites) {
+ $siteObject = Az.Migrate.Internal\Get-AzMigrateHyperVSite @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ }
+
+ if ($null -eq $siteObject) {
+ throw "Machine site not found."
+ }
+ else {
+ $ProjectName = $siteObject.DiscoverySolutionId.Split("/")[8]
+ }
+
+ break;
+ }
+ catch {
+ if ($i -lt $attempts)
+ {
+ Write-Host "Machine site not found. Retrying in 30 seconds..."
+ Start-Sleep -Seconds 30
+ }
+ else
+ {
+ throw "Machine site '$siteName' with Type '$siteType' not found."
+ }
+ }
+ }
+
+ $null = $PSBoundParameters.Remove('SiteName')
+
+ $null = $PSBoundParameters.Add("Name", "Servers-Migration-ServerMigration_DataReplication")
+ $null = $PSBoundParameters.Add("MigrateProjectName", $ProjectName)
+
+ $solution = Az.Migrate\Get-AzMigrateSolution @PSBoundParameters
+ if ($solution -and ($solution.Count -ge 1)) {
+ $VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
+ }
+ else {
+ throw "Solution not found."
+ }
+
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("MigrateProjectName")
+
+ $null = $PSBoundParameters.Add("VaultName", $VaultName)
+ $null = $PSBoundParameters.Add("Name", $ProtectedItemName)
+
+ return Az.Migrate.Internal\Get-AzMigrateProtectedItem @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ }
+
+ if (($parameterSet -match 'List') -or ($parameterSet -eq 'GetByMachineName')) {
+ # Retrieve ResourceGroupName, ProjectName if ListByID
+ if ($parameterSet -eq 'ListByID') {
+ $resourceGroupIdArray = $ResourceGroupID.Split('/')
+ if ($resourceGroupIdArray.Length -lt 5) {
+ throw "Invalid resource group Id '$ResourceGroupID'."
+ }
+
+ $ResourceGroupName = $resourceGroupIdArray[4]
+
+ $projectIdArray = $ProjectID.Split('/')
+ if ($projectIdArray.Length -lt 9) {
+ throw "Invalid migrate project Id '$ProjectID'."
+ }
+
+ $ProjectName = $projectIdArray[8]
+ }
+
+ $null = $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $null = $PSBoundParameters.Add("Name", "Servers-Migration-ServerMigration_DataReplication")
+ $null = $PSBoundParameters.Add("MigrateProjectName", $ProjectName)
+
+ $solution = Az.Migrate\Get-AzMigrateSolution @PSBoundParameters
+ if ($solution -and ($solution.Count -ge 1)) {
+ $VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
+ }
+ else {
+ throw "Solution not found."
+ }
+
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("MigrateProjectName")
+ $null = $PSBoundParameters.Add("VaultName", $VaultName)
+
+ $replicatingItems = Az.Migrate.Internal\Get-AzMigrateProtectedItem @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+
+ if ($parameterSet -eq "GetByMachineName") {
+ $replicatingItems = $replicatingItems | Where-Object { $_.Property.FabricObjectName -eq $MachineName }
+ }
+ return $replicatingItems
+ }
+
+ if (($parameterSet -eq "GetByInputObject") -or ($parameterSet -eq "GetByItemID")) {
+ if ($parameterSet -eq 'GetByInputObject') {
+ $TargetObjectID = $InputObject.Id
+ }
+ $objectIdArray = $TargetObjectID.Split("/")
+ if ($objectIdArray.Length -lt 11) {
+ throw "Invalid target object ID '$TargetObjectID'."
+ }
+
+ $ResourceGroupName = $objectIdArray[4]
+ $VaultName = $objectIdArray[8]
+ $ProtectedItemName = $objectIdArray[10]
+ $null = $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $null = $PSBoundParameters.Add("VaultName", $VaultName)
+ $null = $PSBoundParameters.Add("Name", $ProtectedItemName)
+
+ return Az.Migrate.Internal\Get-AzMigrateProtectedItem @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Helper/AzStackHCICommonSettings.ps1 b/src/Migrate/Migrate.Autorest/custom/Helper/AzStackHCICommonSettings.ps1
new file mode 100644
index 000000000000..b358ef4b966e
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Helper/AzStackHCICommonSettings.ps1
@@ -0,0 +1,78 @@
+$AzStackHCIInstanceTypes = @{
+ HyperVToAzStackHCI = "HyperVToAzStackHCI";
+ VMwareToAzStackHCI = "VMwareToAzStackHCI";
+}
+
+# Fabric instances
+$FabricInstanceTypes = @{
+ HyperVInstance = "HyperVMigrate";
+ VMwareInstance = "VMwareMigrate";
+ AzStackHCIInstance = "AzStackHCI";
+}
+
+$ReplicationDetails = @{
+ PolicyDetails = @{
+ DefaultCrashConsistentFrequencyInMinutes = 60;
+ DefaultAppConsistentFrequencyInMinutes = 240;
+ DefaultRecoveryPointHistoryInMinutes = 4320;
+ };
+ ReplicationPollDelaySeconds = 180;
+ ReplicationTimeoutSeconds = 1800;
+}
+
+$ApiVersions = @{
+ ReplicationPolicy = "2021-02-16-preview";
+ ReplicationFabric = "2021-02-16-preview";
+ ReplicationExtension = "2021-02-16-preview";
+ StorageAccount = "2021-09-01";
+ HyperVSites = "2020-01-01";
+ ProtectedItem = "2021-02-16-preview";
+ AzStackHCI = "2021-09-01-preview";
+}
+
+# Role definition GUIDs for storage account creation
+$RoleDefinitionIds = @{
+ ContributorId = "b24988ac-6180-42a0-ab88-20f7382dd24c";
+ StorageBlobDataContributorId = "ba92f5b4-2d11-453d-a403-e96b0029c9fe";
+}
+
+$RunAsAccountCredentialTypes = @{
+ HyperVFabric = "HyperVFabric";
+ VMwareFabric = "VMwareFabric";
+ DomainCredential = "DomainCredential";
+}
+
+$SiteTypes = @{
+ HyperVSites = "HyperVSites";
+ VMwareSites = "VMwareSites";
+}
+
+$RAMConfig = @{
+ GbToMb = 1024;
+ MinTargetMemoryInMB = 1024; # 1 GB
+ MaxTargetMemoryGen1InMB = 1048576; # 1 TB
+ MaxTargetMemoryGen2InMB = 12582912; # 12 TB
+ DefaultMinDynamicMemoryInMB = 1024; # 1 GB
+ DefaultMaxDynamicMemoryInMB = 1048576; # 1 TB
+ DefaultTargetMemoryBufferPercentage = 20; # 20 %
+ MinTargetMemoryBufferPercentage = 5; # 5 %
+ MaxTargetMemoryBufferPercentage = 2000; # 2000 %
+}
+
+enum ProvisioningState
+{
+ Canceled
+ Creating
+ Deleting
+ Deleted
+ Failed
+ Succeeded
+ Updating
+}
+
+enum StorageAccountProvisioningState
+{
+ Creating
+ ResolvingDNS
+ Succeeded
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Helper/CommonHelper.ps1 b/src/Migrate/Migrate.Autorest/custom/Helper/CommonHelper.ps1
new file mode 100644
index 000000000000..ac37011924e3
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Helper/CommonHelper.ps1
@@ -0,0 +1,179 @@
+function CheckResourceGraphModuleDependency {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()]
+ param()
+
+ process {
+ $module = Get-Module -ListAvailable | Where-Object { $_.Name -eq "Az.ResourceGraph" }
+ if ($null -eq $module) {
+ $message = "Az.ResourceGraph Module must be installed to run this command. Please run 'Install-Module -Name Az.ResourceGraph' to install and continue."
+ throw $message
+ }
+ }
+}
+
+function CheckResourcesModuleDependency {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()]
+ param()
+
+ process {
+ $module = Get-Module -ListAvailable | Where-Object { $_.Name -eq "Az.Resources" }
+ if ($null -eq $module) {
+ $message = "Az.Resources Module must be installed to run this command. Please run 'Install-Module -Name Az.Resources' to install and continue."
+ throw $message
+ }
+ }
+}
+
+function CheckStorageModuleDependency {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()]
+ param()
+
+ process {
+ $module = Get-Module -ListAvailable | Where-Object { $_.Name -eq "Az.Storage" }
+ if ($null -eq $module) {
+ $message = "Az.Storage Module must be installed to run this command. Please run 'Install-Module -Name Az.Storage' to install and continue."
+ throw $message
+ }
+ }
+}
+
+function GetHCIClusterARGQuery {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()]
+ param(
+ [Parameter(Mandatory)]
+ [System.String]
+ # Specifies HCI Cluster Id.
+ ${HCIClusterID}
+ )
+
+ process {
+ $query = @"
+resources | where type == 'microsoft.extendedlocation/customlocations'
+| mv-expand ClusterId = properties['clusterExtensionIds']
+| extend ClusterId = toupper(tostring(ClusterId))
+| extend CustomLocation = toupper(tostring(id))
+| extend resourceBridgeID = toupper(tostring(properties['hostResourceId']))
+| extend customLocationRegion = location
+| join (
+ kubernetesconfigurationresources
+ | where type == 'microsoft.kubernetesconfiguration/extensions'
+ | where properties['ConfigurationSettings']['HCIClusterID'] =~ '$HCIClusterID'
+ | project ClusterId = id
+ | extend ClusterId = toupper(tostring(ClusterId))
+) on ClusterId
+| join (
+ resources
+ | where type == 'microsoft.resourceconnector/appliances'
+ | where properties['provisioningState'] == 'Succeeded'
+ | extend statusOfTheBridge = properties['status']
+ | extend resourceBridgeID = toupper(tostring(id))
+) on resourceBridgeID
+"@
+ return $query
+ }
+}
+
+function IsReservedOrTrademarked {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()]
+ param(
+ [Parameter(Mandatory)]
+ [System.String]
+ # Specifies VM name.
+ ${Value}
+ )
+
+ $uppercased = $Value.ToUpper();
+
+ # cannot be exactly one of these, but could be slighlty differnet (e.g. hololens2)
+ $reservedWords = @(
+ "ACCESS",
+ "APP_CODE",
+ "APP_THEMES",
+ "APP_DATA",
+ "APP_GLOBALRESOURCES",
+ "APP_LOCALRESOURCES",
+ "APP_WEBREFERENCES",
+ "APP_BROWSERS",
+ "AZURE",
+ "BING",
+ "BIZSPARK",
+ "BIZTALK",
+ "CORTANA",
+ "DIRECTX",
+ "DOTNET",
+ "DYNAMICS",
+ "EXCEL",
+ "EXCHANGE",
+ "FOREFRONT",
+ "GROOVE",
+ "HOLOLENS",
+ "HYPERV",
+ "KINECT",
+ "LYNC",
+ "MSDN",
+ "O365",
+ "OFFICE",
+ "OFFICE365",
+ "ONEDRIVE",
+ "ONENOTE",
+ "OUTLOOK",
+ "POWERPOINT",
+ "SHAREPOINT",
+ "SKYPE",
+ "VISIO",
+ "VISUALSTUDIO"
+ )
+
+ # The following words can't be used as either a whole word or a substring in the name:
+ $microsoft = "MICROSOFT";
+ $windows = "WINDOWS";
+
+ # The following words can't be used at the start of a resource name, but can be used later in the name:
+ $startLogin = "LOGIN";
+ $startXbox = "XBOX";
+
+ if ($uppercased.startsWith($startLogin) -or $uppercased.startsWith($startXbox)) {
+ return $true;
+ }
+
+ if ($uppercased.contains($microsoft) -or $uppercased.contains($windows)) {
+ return $true;
+ }
+
+ foreach ($reservedName in $reservedWords) {
+ if ($uppercased -eq $reservedName) {
+ return $true;
+ }
+ }
+
+ return $false;
+}
+
+function GenerateHashForArtifact {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()]
+ param(
+ [Parameter(Mandatory)]
+ [System.String]
+ # Specifies resource group name.
+ ${Artifact}
+ )
+
+ $hashCode = 0
+ $artifactLength = $Artifact.Length
+ $tempItemLength = 0
+ if ($artifactLength -gt 0) {
+ while ($tempItemLength -lt $artifactLength) {
+ $hashCode = ((($hashCode -shl 5) - $hashCode) + $Artifact[$tempItemLength++] -bor 0)
+
+ # Treat as Double, then convert to Bytes, then convert back to Int32 to match JavaScript behavior
+ $hashCode = [System.BitConverter]::ToInt32([System.BitConverter]::GetBytes($hashCode), 0)
+ }
+ }
+
+ if ($hashCode -lt 0) {
+ return -1 * $hashCode
+ }
+ else {
+ return $hashCode
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateHCIReplicationInfrastructure.ps1 b/src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateHCIReplicationInfrastructure.ps1
new file mode 100644
index 000000000000..fb6e1e790348
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateHCIReplicationInfrastructure.ps1
@@ -0,0 +1,1108 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Initializes the infrastructure for the migrate project.
+.Description
+The Initialize-AzMigrateHCIReplicationInfrastructure cmdlet initializes the infrastructure for the migrate project in AzStackHCI scenario.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/initialize-azmigratehcireplicationinfrastructure
+#>
+
+function Initialize-AzMigrateHCIReplicationInfrastructure {
+ [OutputType([System.Boolean], ParameterSetName = 'AzStackHCI')]
+ [CmdletBinding(DefaultParameterSetName = 'AzStackHCI', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the name of the Azure Migrate project to be used for server migration.
+ ${ProjectName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Storage Account ARM Id to be used for private endpoint scenario.
+ ${CacheStorageAccountId},
+
+ [Parameter()]
+ [System.String]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the source appliance name for the AzStackHCI scenario.
+ ${SourceApplianceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the target appliance name for the AzStackHCI scenario.
+ ${TargetApplianceName},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
+ Import-Module $PSScriptRoot\Helper\CommonHelper.ps1
+
+ CheckResourcesModuleDependency
+ CheckStorageModuleDependency
+ Import-Module Az.Resources
+ Import-Module Az.Storage
+
+ $context = Get-AzContext
+ # Get SubscriptionId
+ if ([string]::IsNullOrEmpty($SubscriptionId)) {
+ Write-Host "No -SubscriptionId provided. Using the one from Get-AzContext."
+
+ $SubscriptionId = $context.Subscription.Id
+ if ([string]::IsNullOrEmpty($SubscriptionId)) {
+ throw "Please login to Azure to select a subscription."
+ }
+ }
+ Write-Host "*Selected Subscription Id: '$($SubscriptionId)'."
+
+ # Get resource group
+ $resourceGroup = Get-AzResourceGroup -Name $ResourceGroupName -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ if ($null -eq $resourceGroup) {
+ throw "Resource group '$($ResourceGroupName)' does not exist in the subscription. Please create the resource group and try again."
+ }
+ Write-Host "*Selected Resource Group: '$($ResourceGroupName)'."
+
+ # Verify user validity
+ $userObject = Get-AzADUser -UserPrincipalName $context.Subscription.ExtendedProperties.Account
+
+ if (-not $userObject) {
+ $userObject = Get-AzADUser -Mail $context.Subscription.ExtendedProperties.Account
+ }
+
+ if (-not $userObject) {
+ $mailNickname = "{0}#EXT#" -f $($context.Account.Id -replace '@', '_')
+
+ $userObject = Get-AzADUser |
+ Where-Object { $_.MailNickname -eq $mailNickname }
+ }
+
+ if (-not $userObject) {
+ $userObject = Get-AzADServicePrincipal -ApplicationID $context.Account.Id
+ }
+
+ if (-not $userObject) {
+ throw 'User Object Id Not Found!'
+ }
+
+ # Get Migrate Project
+ $migrateProject = Az.Migrate\Get-AzMigrateProject `
+ -Name $ProjectName `
+ -ResourceGroupName $ResourceGroupName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $migrateProject) {
+ throw "Migrate project '$($ProjectName)' not found."
+ }
+
+ # Access Discovery Service
+ $discoverySolutionName = "Servers-Discovery-ServerDiscovery"
+ $discoverySolution = Az.Migrate\Get-AzMigrateSolution `
+ -SubscriptionId $SubscriptionId `
+ -ResourceGroupName $ResourceGroupName `
+ -MigrateProjectName $ProjectName `
+ -Name $discoverySolutionName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($discoverySolution.Name -ne $discoverySolutionName) {
+ throw "Server Discovery Solution not found."
+ }
+
+ # Get Appliances Mapping
+ $appMap = @{}
+ if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"]) {
+ $appMapV2 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] | ConvertFrom-Json
+ # Fetch all appliance from V2 map first. Then these can be updated if found again in V3 map.
+ foreach ($item in $appMapV2) {
+ $appMap[$item.ApplianceName.ToLower()] = $item.SiteId
+ }
+ }
+
+ if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"]) {
+ $appMapV3 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] | ConvertFrom-Json
+ foreach ($item in $appMapV3) {
+ $t = $item.psobject.properties
+ $appMap[$t.Name.ToLower()] = $t.Value.SiteId
+ }
+ }
+
+ if ($null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] -And
+ $null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] ) {
+ throw "Server Discovery Solution missing Appliance Details. Invalid Solution."
+ }
+
+ $hyperVSiteTypeRegex = "(?<=/Microsoft.OffAzure/HyperVSites/).*$"
+ $vmwareSiteTypeRegex = "(?<=/Microsoft.OffAzure/VMwareSites/).*$"
+
+ # Validate SourceApplianceName & TargetApplianceName
+ $sourceSiteId = $appMap[$SourceApplianceName.ToLower()]
+ $targetSiteId = $appMap[$TargetApplianceName.ToLower()]
+ if ($sourceSiteId -match $hyperVSiteTypeRegex -and $targetSiteId -match $hyperVSiteTypeRegex) {
+ $instanceType = $AzStackHCIInstanceTypes.HyperVToAzStackHCI
+ }
+ elseif ($sourceSiteId -match $vmwareSiteTypeRegex -and $targetSiteId -match $hyperVSiteTypeRegex) {
+ $instanceType = $AzStackHCIInstanceTypes.VMwareToAzStackHCI
+ }
+ else {
+ throw "Error encountered in matching the given source appliance name '$SourceApplianceName' and target appliance name '$TargetApplianceName'. Please verify the VM site type to be either for HyperV or VMware for both source and target appliances, and the appliance names are correct."
+ }
+
+ # Get Data Replication Service, or the AMH solution
+ $amhSolution = Az.Migrate\Get-AzMigrateSolution `
+ -ResourceGroupName $ResourceGroupName `
+ -MigrateProjectName $ProjectName `
+ -Name "Servers-Migration-ServerMigration_DataReplication" `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $amhSolution) {
+ throw "No Data Replication Service Solution found. Please verify your appliance setup."
+ }
+
+ # Get Source and Target Fabrics
+ $allFabrics = Az.Migrate\Get-AzMigrateHCIReplicationFabric -ResourceGroupName $ResourceGroupName
+ foreach ($fabric in $allFabrics) {
+ if ($fabric.Property.CustomProperty.MigrationSolutionId -ne $amhSolution.Id) {
+ continue
+ }
+
+ if (($instanceType -eq $AzStackHCIInstanceTypes.HyperVToAzStackHCI) -and
+ ($fabric.Property.CustomProperty.InstanceType -ceq $FabricInstanceTypes.HyperVInstance)) {
+ $sourceFabric = $fabric
+ }
+ elseif (($instanceType -eq $AzStackHCIInstanceTypes.VMwareToAzStackHCI) -and
+ ($fabric.Property.CustomProperty.InstanceType -ceq $FabricInstanceTypes.VMwareInstance)) {
+ $sourceFabric = $fabric
+ }
+ elseif ($fabric.Property.CustomProperty.InstanceType -ceq $FabricInstanceTypes.AzStackHCIInstance) {
+ $targetFabric = $fabric
+ }
+
+ if (($null -ne $sourceFabric) -and ($null -ne $targetFabric)) {
+ break
+ }
+ }
+
+ if ($null -eq $sourceFabric) {
+ throw "Source Fabric not found. Please verify your appliance setup."
+ }
+ Write-Host "*Selected Source Fabric: '$($sourceFabric.Name)'."
+
+ if ($null -eq $targetFabric) {
+ throw "Target Fabric not found. Please verify your appliance setup."
+ }
+ Write-Host "*Selected Target Fabric: '$($targetFabric.Name)'."
+
+ # Get Source and Target Dras from Fabrics
+ $sourceDras = Az.Migrate.Internal\Get-AzMigrateDra `
+ -FabricName $sourceFabric.Name `
+ -ResourceGroupName $ResourceGroupName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $sourceDras) {
+ throw "Source Dra found. Please verify your appliance setup."
+ }
+ $sourceDra = $sourceDras[0]
+ Write-Host "*Selected Source Dra: '$($sourceDra.Name)'."
+
+ $targetDras = Az.Migrate.Internal\Get-AzMigrateDra `
+ -FabricName $targetFabric.Name `
+ -ResourceGroupName $ResourceGroupName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $targetDras) {
+ throw "Source Dra found. Please verify your appliance setup."
+ }
+ $targetDra = $targetDras[0]
+ Write-Host "*Selected Target Dra: '$($targetDra.Name)'."
+
+ # Get Replication Vault
+ $replicationVaultName = $amhSolution.DetailExtendedDetail["vaultId"].Split("/")[8]
+ $replicationVault = Az.Migrate.Internal\Get-AzMigrateVault `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $replicationVaultName
+ if ($null -eq $replicationVault) {
+ throw "No Replication Vault found in Resource Group '$($ResourceGroupName)'."
+ }
+
+ # Put Policy
+ $policyName = $replicationVault.Name + $instanceType + "policy"
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $policyName `
+ -VaultName $replicationVault.Name `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ # Default policy is found
+ if ($null -ne $policy) {
+ # Give time for create/update to reach a terminal state. Timeout after 10min
+ if ($policy.Property.ProvisioningState -eq [ProvisioningState]::Creating -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Updating) {
+ Write-Host "Policy '$($policyName)' found in Provisioning State '$($policy.Property.ProvisioningState)'."
+
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy -InputObject $policy
+
+ if (-not (
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Creating -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Updating)) {
+ break
+ }
+ }
+
+ # Make sure Policy is no longer in Creating or Updating state
+ if ($policy.Property.ProvisioningState -eq [ProvisioningState]::Creating -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Updating) {
+ throw "Policy '$($policyName)' times out with Provisioning State: '$($policy.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Check and remove if policy is in a bad terminal state
+ if ($policy.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Failed) {
+ Write-Host "Policy '$($policyName)' found but in an unusable terminal Provisioning State '$($policy.Property.ProvisioningState)'.`nRemoving policy..."
+
+ # Remove policy
+ try {
+ Az.Migrate.Internal\Remove-AzMigratePolicy -InputObject $policy | Out-Null
+ }
+ catch {
+ if ($_.Exception.Message -notmatch "Status: OK") {
+ throw $_.Exception.Message
+ }
+ }
+
+ Start-Sleep -Seconds 30
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy `
+ -InputObject $policy `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ # Make sure Policy is no longer in Canceled or Failed state
+ if ($null -ne $policy -and
+ ($policy.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Failed)) {
+ throw "Failed to change the Provisioning State of policy '$($policyName)'by removing. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Give time to remove policy. Timeout after 10min
+ if ($null -eq $policy -and $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleting) {
+ Write-Host "Policy '$($policyName)' found in Provisioning State '$($policy.Property.ProvisioningState)'."
+
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy `
+ -InputObject $policy `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ if ($null -eq $policy -or $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleted) {
+ break
+ }
+ elseif ($policy.Property.ProvisioningState -eq [ProvisioningState]::Deleting) {
+ continue
+ }
+
+ throw "Policy '$($policyName)' has an unexpected Provisioning State of '$($policy.Property.ProvisioningState)' during removal process. Please re-run this command or contact support if help needed."
+ }
+
+ # Make sure Policy is no longer in Deleting state
+ if ($null -ne $policy -and $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleting) {
+ throw "Policy '$($policyName)' times out with Provisioning State: '$($policy.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Indicate policy was removed
+ if ($null -eq $policy -or $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleted) {
+ Write-Host "Policy '$($policyName)' was removed."
+ }
+ }
+
+ # Refresh local policy object if exists
+ if ($null -ne $policy) {
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy -InputObject $policy
+ }
+
+ # Create policy if not found or previously deleted
+ if ($null -eq $policy -or $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleted) {
+ Write-Host "Creating Policy..."
+
+ $params = @{
+ InstanceType = $instanceType;
+ RecoveryPointHistoryInMinute = $ReplicationDetails.PolicyDetails.DefaultRecoveryPointHistoryInMinutes;
+ CrashConsistentFrequencyInMinute = $ReplicationDetails.PolicyDetails.DefaultCrashConsistentFrequencyInMinutes;
+ AppConsistentFrequencyInMinute = $ReplicationDetails.PolicyDetails.DefaultAppConsistentFrequencyInMinutes;
+ }
+
+ # Setup Policy deployment parameters
+ $policyProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PolicyModelProperties]::new()
+ if ($instanceType -eq $AzStackHCIInstanceTypes.HyperVToAzStackHCI) {
+ $policyCustomProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcipolicyModelCustomProperties]::new()
+ }
+ elseif ($instanceType -eq $AzStackHCIInstanceTypes.VMwareToAzStackHCI) {
+ $policyCustomProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcipolicyModelCustomProperties]::new()
+ }
+ else {
+ throw "Instance type '$($instanceType)' is not supported. Currently, for AzStackHCI scenario, only HyperV and VMware as the source is supported."
+ }
+ $policyCustomProperties.InstanceType = $params.InstanceType
+ $policyCustomProperties.RecoveryPointHistoryInMinute = $params.RecoveryPointHistoryInMinute
+ $policyCustomProperties.CrashConsistentFrequencyInMinute = $params.CrashConsistentFrequencyInMinute
+ $policyCustomProperties.AppConsistentFrequencyInMinute = $params.AppConsistentFrequencyInMinute
+ $policyProperties.CustomProperty = $policyCustomProperties
+
+ try {
+ Az.Migrate.Internal\New-AzMigratePolicy `
+ -Name $policyName `
+ -ResourceGroupName $ResourceGroupName `
+ -VaultName $replicationVaultName `
+ -Property $policyProperties `
+ -SubscriptionId $SubscriptionId `
+ -NoWait | Out-Null
+ }
+ catch {
+ if ($_.Exception.Message -notmatch "Status: OK") {
+ throw $_.Exception.Message
+ }
+ }
+
+ # Check Policy creation status every 30s. Timeout after 10min
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $policyName `
+ -VaultName $replicationVault.Name `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $policy) {
+ throw "Unexpected error occurred during policy creation. Please re-run this command or contact support if help needed."
+ }
+
+ # Stop if policy reaches a terminal state
+ if ($policy.Property.ProvisioningState -eq [ProvisioningState]::Succeeded -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleted -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Failed) {
+ break
+ }
+ }
+
+ # Make sure Policy is in a terminal state
+ if (-not (
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Succeeded -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Deleted -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $policy.Property.ProvisioningState -eq [ProvisioningState]::Failed)) {
+ throw "Policy '$($policyName)' times out with Provisioning State: '$($policy.Property.ProvisioningState)' during creation process. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ if ($policy.Property.ProvisioningState -ne [ProvisioningState]::Succeeded) {
+ throw "Policy '$($policyName)' has an unexpected Provisioning State of '$($policy.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+
+ $policy = Az.Migrate.Internal\Get-AzMigratePolicy `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $policyName `
+ -VaultName $replicationVault.Name `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $policy) {
+ throw "Unexpected error occurred during policy creation. Please re-run this command or contact support if help needed."
+ }
+ elseif ($policy.Property.ProvisioningState -ne [ProvisioningState]::Succeeded) {
+ throw "Policy '$($policyName)' has an unexpected Provisioning State of '$($policy.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ else {
+ Write-Host "*Selected Policy: '$($policyName)'."
+ }
+
+ # Put Cache Storage Account
+ $amhSolution = Az.Migrate\Get-AzMigrateSolution `
+ -ResourceGroupName $ResourceGroupName `
+ -MigrateProjectName $ProjectName `
+ -Name "Servers-Migration-ServerMigration_DataReplication" `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $amhSolution) {
+ throw "No Data Replication Service Solution found. Please verify your appliance setup."
+ }
+
+ $amhStoredStorageAccountId = $amhSolution.DetailExtendedDetail["replicationStorageAccountId"]
+
+ # Record of rsa found in AMH solution
+ if (![string]::IsNullOrEmpty($amhStoredStorageAccountId)) {
+ $amhStoredStorageAccountName = $amhStoredStorageAccountId.Split("/")[8]
+ $amhStoredStorageAccount = Get-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $amhStoredStorageAccountName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ # Wait for amhStoredStorageAccount to reach a terminal state
+ if ($null -ne $amhStoredStorageAccount -and
+ $null -ne $amhStoredStorageAccount.ProvisioningState -and
+ $amhStoredStorageAccount.ProvisioningState -ne [StorageAccountProvisioningState]::Succeeded) {
+ # Check rsa state every 30s if not Succeeded already. Timeout after 10min
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $amhStoredStorageAccount = Get-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $amhStoredStorageAccountName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ # Stop if amhStoredStorageAccount is not found or in a terminal state
+ if ($null -eq $amhStoredStorageAccount -or
+ $null -eq $amhStoredStorageAccount.ProvisioningState -or
+ $amhStoredStorageAccount.ProvisioningState -eq [StorageAccountProvisioningState]::Succeeded) {
+ break
+ }
+ }
+ }
+
+ # amhStoredStorageAccount exists and in Succeeded state
+ if ($null -ne $amhStoredStorageAccount -and
+ $amhStoredStorageAccount.ProvisioningState -eq [StorageAccountProvisioningState]::Succeeded) {
+ # Use amhStoredStorageAccount and ignore user provided Cache Storage Account Id
+ if (![string]::IsNullOrEmpty($CacheStorageAccountId) -and $amhStoredStorageAccount.Id -ne $CacheStorageAccountId) {
+ Write-Host "A Cache Storage Account '$($amhStoredStorageAccountName)' has been linked already. The given -CacheStorageAccountId '$($CacheStorageAccountId)' will be ignored."
+ }
+
+ $cacheStorageAccount = $amhStoredStorageAccount
+ }
+ elseif ($null -eq $amhStoredStorageAccount -or $null -eq $amhStoredStorageAccount.ProvisioningState) {
+ # amhStoredStorageAccount is found but in a bad state, so log to ask user to remove
+ if ($null -ne $amhStoredStorageAccount -and $null -eq $amhStoredStorageAccount.ProvisioningState) {
+ Write-Host "A previously linked Cache Storage Account with Id '$($amhStoredStorageAccountId)' is found but in a unusable state. Please remove it manually and re-run this command."
+ }
+
+ # amhStoredStorageAccount is not found or in a bad state but AMH has a record of it, so remove the record
+ if ($amhSolution.DetailExtendedDetail.ContainsKey("replicationStorageAccountId")) {
+ $amhSolution.DetailExtendedDetail.Remove("replicationStorageAccountId") | Out-Null
+ $amhSolution.DetailExtendedDetail.Add("replicationStorageAccountId", $null) | Out-Null
+ Az.Migrate.Internal\Set-AzMigrateSolution `
+ -MigrateProjectName $ProjectName `
+ -Name $amhSolution.Name `
+ -ResourceGroupName $ResourceGroupName `
+ -DetailExtendedDetail $amhSolution.DetailExtendedDetail.AdditionalProperties | Out-Null
+ }
+ }
+ else {
+ throw "A linked Cache Storage Account with Id '$($amhStoredStorageAccountId)' times out with Provisioning State: '$($amhStoredStorageAccount.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+
+ $amhSolution = Az.Migrate\Get-AzMigrateSolution `
+ -ResourceGroupName $ResourceGroupName `
+ -MigrateProjectName $ProjectName `
+ -Name "Servers-Migration-ServerMigration_DataReplication" `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ # Check if AMH record is removed
+ if (($null -eq $amhStoredStorageAccount -or $null -eq $amhStoredStorageAccount.ProvisioningState) -and
+ ![string]::IsNullOrEmpty($amhSolution.DetailExtendedDetail["replicationStorageAccountId"])) {
+ throw "Unexpected error occurred in unlinking Cache Storage Account with Id '$($amhSolution.DetailExtendedDetail["replicationStorageAccountId"])'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # No linked Cache Storage Account found in AMH solution but user provides a Cache Storage Account Id
+ if ($null -eq $cacheStorageAccount -and ![string]::IsNullOrEmpty($CacheStorageAccountId)) {
+ $userProvidedStorageAccountIdSegs = $CacheStorageAccountId.Split("/")
+ if ($userProvidedStorageAccountIdSegs.Count -ne 9) {
+ throw "Invalid Cache Storage Account Id '$($CacheStorageAccountId)' provided. Please provide a valid one."
+ }
+
+ $userProvidedStorageAccountName = ($userProvidedStorageAccountIdSegs[8]).ToLower()
+
+ # Check if user provided Cache Storage Account exists
+ $userProvidedStorageAccount = Get-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $userProvidedStorageAccountName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ # Wait for userProvidedStorageAccount to reach a terminal state
+ if ($null -ne $userProvidedStorageAccount -and
+ $null -ne $userProvidedStorageAccount.ProvisioningState -and
+ $userProvidedStorageAccount.ProvisioningState -ne [StorageAccountProvisioningState]::Succeeded) {
+ # Check rsa state every 30s if not Succeeded already. Timeout after 10min
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $userProvidedStorageAccount = Get-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $userProvidedStorageAccountName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ # Stop if userProvidedStorageAccount is not found or in a terminal state
+ if ($null -eq $userProvidedStorageAccount -or
+ $null -eq $userProvidedStorageAccount.ProvisioningState -or
+ $userProvidedStorageAccount.ProvisioningState -eq [StorageAccountProvisioningState]::Succeeded) {
+ break
+ }
+ }
+ }
+
+ if ($null -ne $userProvidedStorageAccount -and
+ $userProvidedStorageAccount.ProvisioningState -eq [StorageAccountProvisioningState]::Succeeded) {
+ $cacheStorageAccount = $userProvidedStorageAccount
+ }
+ elseif ($null -eq $userProvidedStorageAccount) {
+ throw "Cache Storage Account with Id '$($CacheStorageAccountId)' is not found. Please re-run this command without -CacheStorageAccountId to create one automatically or re-create the Cache Storage Account yourself and try again."
+ }
+ elseif ($null -eq $userProvidedStorageAccount.ProvisioningState) {
+ throw "Cache Storage Account with Id '$($CacheStorageAccountId)' is found but in an unusable state. Please re-run this command without -CacheStorageAccountId to create one automatically or re-create the Cache Storage Account yourself and try again."
+ }
+ else {
+ throw "Cache Storage Account with Id '$($CacheStorageAccountId)' is found but times out with Provisioning State: '$($userProvidedStorageAccount.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # No Cache Storage Account found or provided, so create one
+ if ($null -eq $cacheStorageAccount) {
+ $suffix = (GenerateHashForArtifact -Artifact "$($sourceSiteId)/$($SourceApplianceName)").ToString()
+ if ($suffixHash.Length -gt 14) {
+ $suffix = $suffixHash.Substring(0, 14)
+ }
+ $cacheStorageAccountName = "migratersa" + $suffix
+ $cacheStorageAccountId = "/subscriptions/$($SubscriptionId)/resourceGroups/$($ResourceGroupName)/providers/Microsoft.Storage/storageAccounts/$($cacheStorageAccountName)"
+
+ # Check if default Cache Storage Account already exists, which it shoudln't
+ $cacheStorageAccount = Get-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $cacheStorageAccountName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -ne $cacheStorageAccount) {
+ throw "Unexpected error encountered: Cache Storage Account '$($cacheStorageAccountName)' already exists. Please re-run this command to create a different one or contact support if help needed."
+ }
+
+ Write-Host "Creating Cache Storage Account with default name '$($cacheStorageAccountName)'..."
+
+ $params = @{
+ name = $cacheStorageAccountName;
+ location = $migrateProject.Location;
+ migrateProjectName = $migrateProject.Name;
+ skuName = "Standard_LRS";
+ tags = @{ "Migrate Project" = $migrateProject.Name };
+ kind = "StorageV2";
+ encryption = @{ services = @{blob = @{ enabled = $true }; file = @{ enabled = $true } } };
+ }
+
+ # Create Cache Storage Account
+ $cacheStorageAccount = New-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $params.name `
+ -SkuName $params.skuName `
+ -Location $params.location `
+ -Kind $params.kind `
+ -Tags $params.tags `
+ -AllowBlobPublicAccess $true
+
+ if ($null -ne $cacheStorageAccount -and
+ $null -ne $cacheStorageAccount.ProvisioningState -and
+ $cacheStorageAccount.ProvisioningState -ne [StorageAccountProvisioningState]::Succeeded) {
+ # Check rsa state every 30s if not Succeeded already. Timeout after 10min
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $cacheStorageAccount = Get-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $params.name `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ # Stop if cacheStorageAccount is not found or in a terminal state
+ if ($null -eq $cacheStorageAccount -or
+ $null -eq $cacheStorageAccount.ProvisioningState -or
+ $cacheStorageAccount.ProvisioningState -eq [StorageAccountProvisioningState]::Succeeded) {
+ break
+ }
+ }
+ }
+
+ if ($null -eq $cacheStorageAccount -or $null -eq $cacheStorageAccount.ProvisioningState) {
+ throw "Unexpected error occurs during Cache Storgae Account creation process. Please re-run this command or provide -CacheStorageAccountId of the one created own your own."
+ }
+ elseif ($cacheStorageAccount.ProvisioningState -ne [StorageAccountProvisioningState]::Succeeded) {
+ throw "Cache Storage Account with Id '$($cacheStorageAccount.Id)' times out with Provisioning State: '$($cacheStorageAccount.ProvisioningState)' during creation process. Please remove it manually and re-run this command or contact support if help needed."
+ }
+ }
+
+ # Sanity check
+ if ($null -eq $cacheStorageAccount -or
+ $null -eq $cacheStorageAccount.ProvisioningState -or
+ $cacheStorageAccount.ProvisioningState -ne [StorageAccountProvisioningState]::Succeeded) {
+ throw "Unexpected error occurs during Cache Storgae Account selection process. Please re-run this command or contact support if help needed."
+ }
+
+ $params = @{
+ contributorRoleDefId = [System.Guid]::parse($RoleDefinitionIds.ContributorId);
+ storageBlobDataContributorRoleDefId = [System.Guid]::parse($RoleDefinitionIds.StorageBlobDataContributorId);
+ sourceAppAadId = $sourceDra.ResourceAccessIdentityObjectId;
+ targetAppAadId = $targetDra.ResourceAccessIdentityObjectId;
+ }
+
+ # Grant Source Dra AAD App access to Cache Storage Account as "Contributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.sourceAppAadId `
+ -RoleDefinitionId $params.contributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $hasAadAppAccess) {
+ New-AzRoleAssignment `
+ -ObjectId $params.sourceAppAadId `
+ -RoleDefinitionId $params.contributorRoleDefId `
+ -Scope $cacheStorageAccount.Id | Out-Null
+ }
+
+ # Grant Source Dra AAD App access to Cache Storage Account as "StorageBlobDataContributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.sourceAppAadId `
+ -RoleDefinitionId $params.storageBlobDataContributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $hasAadAppAccess) {
+ New-AzRoleAssignment `
+ -ObjectId $params.sourceAppAadId `
+ -RoleDefinitionId $params.storageBlobDataContributorRoleDefId `
+ -Scope $cacheStorageAccount.Id | Out-Null
+ }
+
+ # Grant Target Dra AAD App access to Cache Storage Account as "Contributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.targetAppAadId `
+ -RoleDefinitionId $params.contributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $hasAadAppAccess) {
+ New-AzRoleAssignment `
+ -ObjectId $params.targetAppAadId `
+ -RoleDefinitionId $params.contributorRoleDefId `
+ -Scope $cacheStorageAccount.Id | Out-Null
+ }
+
+ # Grant Target Dra AAD App access to Cache Storage Account as "StorageBlobDataContributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.targetAppAadId `
+ -RoleDefinitionId $params.storageBlobDataContributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $hasAadAppAccess) {
+ New-AzRoleAssignment `
+ -ObjectId $params.targetAppAadId `
+ -RoleDefinitionId $params.storageBlobDataContributorRoleDefId `
+ -Scope $cacheStorageAccount.Id | Out-Null
+ }
+
+ # Give time for role assignments to be created. Times out after 2min
+ $rsaPermissionGranted = $false
+ for ($i = 0; $i -lt 4; $i++) {
+ # Check Source Dra AAD App access to Cache Storage Account as "Contributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.sourceAppAadId `
+ -RoleDefinitionId $params.contributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ $rsaPermissionGranted = $null -ne $hasAadAppAccess
+
+ # Check Source Dra AAD App access to Cache Storage Account as "StorageBlobDataContributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.sourceAppAadId `
+ -RoleDefinitionId $params.storageBlobDataContributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ $rsaPermissionGranted = $rsaPermissionGranted -and ($null -ne $hasAadAppAccess)
+
+ # Check Target Dra AAD App access to Cache Storage Account as "Contributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.targetAppAadId `
+ -RoleDefinitionId $params.contributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ $rsaPermissionGranted = $rsaPermissionGranted -and ($null -ne $hasAadAppAccess)
+
+ # Check Target Dra AAD App access to Cache Storage Account as "StorageBlobDataContributor"
+ $hasAadAppAccess = Get-AzRoleAssignment `
+ -ObjectId $params.targetAppAadId `
+ -RoleDefinitionId $params.storageBlobDataContributorRoleDefId `
+ -Scope $cacheStorageAccount.Id `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ $rsaPermissionGranted = $rsaPermissionGranted -and ($null -ne $hasAadAppAccess)
+
+ if ($rsaPermissionGranted) {
+ break
+ }
+
+ Start-Sleep -Seconds 30
+ }
+
+ if (!$rsaPermissionGranted) {
+ throw "Failed to grant Cache Storage Account permissions. Please re-run this command or contact support if help needed."
+ }
+
+ $amhSolution = Az.Migrate\Get-AzMigrateSolution `
+ -ResourceGroupName $ResourceGroupName `
+ -MigrateProjectName $ProjectName `
+ -Name "Servers-Migration-ServerMigration_DataReplication" `
+ -SubscriptionId $SubscriptionId
+ if ($amhSolution.DetailExtendedDetail.ContainsKey("replicationStorageAccountId")) {
+ $amhStoredStorageAccountId = $amhSolution.DetailExtendedDetail["replicationStorageAccountId"]
+ if ([string]::IsNullOrEmpty($amhStoredStorageAccountId)) {
+ # Remove "replicationStorageAccountId" key
+ $amhSolution.DetailExtendedDetail.Remove("replicationStorageAccountId") | Out-Null
+ }
+ elseif ($amhStoredStorageAccountId -ne $cacheStorageAccount.Id) {
+ # Record of rsa mismatch
+ throw "Unexpected error occurred in linking Cache Storage Account with Id '$($cacheStorageAccount.Id)'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Update AMH record with chosen Cache Storage Account
+ if (!$amhSolution.DetailExtendedDetail.ContainsKey("replicationStorageAccountId")) {
+ $amhSolution.DetailExtendedDetail.Add("replicationStorageAccountId", $cacheStorageAccount.Id)
+ Az.Migrate.Internal\Set-AzMigrateSolution `
+ -MigrateProjectName $ProjectName `
+ -Name $amhSolution.Name `
+ -ResourceGroupName $ResourceGroupName `
+ -DetailExtendedDetail $amhSolution.DetailExtendedDetail.AdditionalProperties | Out-Null
+ }
+
+ Write-Host "*Selected Cache Storage Account: '$($cacheStorageAccount.StorageAccountName)' in Resource Group '$($ResourceGroupName)' at Location '$($cacheStorageAccount.Location)' for Migrate Project '$($migrateProject.Name)'."
+
+ # Put replication extension
+ $replicationExtensionName = ($sourceFabric.Id -split '/')[-1] + "-" + ($targetFabric.Id -split '/')[-1] + "-MigReplicationExtn"
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $replicationExtensionName `
+ -VaultName $replicationVaultName `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ # Remove replication extension if does not match the selected Cache Storage Account
+ if ($null -ne $replicationExtension -and $replicationExtension.Property.CustomProperty.StorageAccountId -ne $cacheStorageAccount.Id) {
+ Write-Host "Replication Extension '$($replicationExtensionName)' found but linked to a different Cache Storage Account '$($replicationExtension.Property.CustomProperty.StorageAccountId)'."
+
+ try {
+ Az.Migrate.Internal\Remove-AzMigrateReplicationExtension -InputObject $replicationExtension | Out-Null
+ }
+ catch {
+ if ($_.Exception.Message -notmatch "Status: OK") {
+ throw $_.Exception.Message
+ }
+ }
+
+ Write-Host "Removing Replication Extension and waiting for 2 minutes..."
+ Start-Sleep -Seconds 120
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -InputObject $replicationExtension `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ if ($null -eq $replicationExtension) {
+ Write-Host "Replication Extension '$($replicationExtensionName)' was removed."
+ }
+ }
+
+ # Replication extension exists
+ if ($null -ne $replicationExtension) {
+ # Give time for create/update to reach a terminal state. Timeout after 10min
+ if ($replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Creating -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Updating) {
+ Write-Host "Replication Extension '$($replicationExtensionName)' found in Provisioning State '$($replicationExtension.Property.ProvisioningState)'."
+
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -InputObject $replicationExtension `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ if (-not (
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Creating -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Updating)) {
+ break
+ }
+ }
+
+ # Make sure replication extension is no longer in Creating or Updating state
+ if ($replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Creating -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Updating) {
+ throw "Replication Extension '$($replicationExtensionName)' times out with Provisioning State: '$($replicationExtension.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Check and remove if replication extension is in a bad terminal state
+ if ($replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Failed) {
+ Write-Host "Replication Extension '$($replicationExtensionName)' found but in an unusable terminal Provisioning State '$($replicationExtension.Property.ProvisioningState)'.`nRemoving Replication Extension..."
+
+ # Remove replication extension
+ try {
+ Az.Migrate.Internal\Remove-AzMigrateReplicationExtension -InputObject $replicationExtension | Out-Null
+ }
+ catch {
+ if ($_.Exception.Message -notmatch "Status: OK") {
+ throw $_.Exception.Message
+ }
+ }
+
+ Start-Sleep -Seconds 30
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -InputObject $replicationExtension `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ # Make sure replication extension is no longer in Canceled or Failed state
+ if ($null -ne $replicationExtension -and
+ ($replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Failed)) {
+ throw "Failed to change the Provisioning State of Replication Extension '$($replicationExtensionName)'by removing. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Give time to remove replication extension. Timeout after 10min
+ if ($null -ne $replicationExtension -and
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleting) {
+ Write-Host "Replication Extension '$($replicationExtensionName)' found in Provisioning State '$($replicationExtension.Property.ProvisioningState)'."
+
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -InputObject $replicationExtension `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ if ($null -eq $replicationExtension -or $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleted) {
+ break
+ }
+ elseif ($replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleting) {
+ continue
+ }
+
+ throw "Replication Extension '$($replicationExtensionName)' has an unexpected Provisioning State of '$($replicationExtension.Property.ProvisioningState)' during removal process. Please re-run this command or contact support if help needed."
+ }
+
+ # Make sure replication extension is no longer in Deleting state
+ if ($null -ne $replicationExtension -and $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleting) {
+ throw "Replication Extension '$($replicationExtensionName)' times out with Provisioning State: '$($replicationExtension.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ # Indicate replication extension was removed
+ if ($null -eq $replicationExtension -or $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleted) {
+ Write-Host "Replication Extension '$($replicationExtensionName)' was removed."
+ }
+ }
+
+ # Refresh local replication extension object if exists
+ if ($null -ne $replicationExtension) {
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension -InputObject $replicationExtension
+ }
+
+ # Create replication extension if not found or previously deleted
+ if ($null -eq $replicationExtension -or $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleted) {
+ Write-Host "Waiting 2 minutes for permissions to sync before creating Replication Extension..."
+ Start-Sleep -Seconds 120
+
+ Write-Host "Creating Replication Extension..."
+ $params = @{
+ InstanceType = $instanceType;
+ SourceFabricArmId = $sourceFabric.Id;
+ TargetFabricArmId = $targetFabric.Id;
+ StorageAccountId = $cacheStorageAccount.Id;
+ StorageAccountSasSecretName = $null;
+ }
+
+ # Setup Replication Extension deployment parameters
+ $replicationExtensionProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ReplicationExtensionModelProperties]::new()
+
+ if ($instanceType -eq $AzStackHCIInstanceTypes.HyperVToAzStackHCI) {
+ $replicationExtensionCustomProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHcireplicationExtensionModelCustomProperties]::new()
+ $replicationExtensionCustomProperties.HyperVFabricArmId = $params.SourceFabricArmId
+
+ }
+ elseif ($instanceType -eq $AzStackHCIInstanceTypes.VMwareToAzStackHCI) {
+ $replicationExtensionCustomProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHcireplicationExtensionModelCustomProperties]::new()
+ $replicationExtensionCustomProperties.VMwareFabricArmId = $params.SourceFabricArmId
+ }
+ else {
+ throw "Currently, for AzStackHCI scenario, only HyperV and VMware as the source is supported."
+ }
+ $replicationExtensionCustomProperties.InstanceType = $params.InstanceType
+ $replicationExtensionCustomProperties.AzStackHCIFabricArmId = $params.TargetFabricArmId
+ $replicationExtensionCustomProperties.StorageAccountId = $params.StorageAccountId
+ $replicationExtensionCustomProperties.StorageAccountSasSecretName = $params.StorageAccountSasSecretName
+ $replicationExtensionProperties.CustomProperty = $replicationExtensionCustomProperties
+
+ try {
+ Az.Migrate.Internal\New-AzMigrateReplicationExtension `
+ -Name $replicationExtensionName `
+ -ResourceGroupName $ResourceGroupName `
+ -VaultName $replicationVaultName `
+ -Property $replicationExtensionProperties `
+ -SubscriptionId $SubscriptionId `
+ -NoWait | Out-Null
+ }
+ catch {
+ if ($_.Exception.Message -notmatch "Status: OK") {
+ throw $_.Exception.Message
+ }
+ }
+
+ # Check replication extension creation status every 30s. Timeout after 10min
+ for ($i = 0; $i -lt 20; $i++) {
+ Start-Sleep -Seconds 30
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $replicationExtensionName `
+ -VaultName $replicationVaultName `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $replicationExtension) {
+ throw "Unexpected error occurred during Replication Extension creation. Please re-run this command or contact support if help needed."
+ }
+
+ # Stop if replication extension reaches a terminal state
+ if ($replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Succeeded -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleted -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Failed) {
+ break
+ }
+ }
+
+ # Make sure replicationExtension is in a terminal state
+ if (-not (
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Succeeded -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Deleted -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Canceled -or
+ $replicationExtension.Property.ProvisioningState -eq [ProvisioningState]::Failed)) {
+ throw "Replication Extension '$($replicationExtensionName)' times out with Provisioning State: '$($replicationExtension.Property.ProvisioningState)' during creation process. Please re-run this command or contact support if help needed."
+ }
+ }
+
+ if ($replicationExtension.Property.ProvisioningState -ne [ProvisioningState]::Succeeded) {
+ throw "Replication Extension '$($replicationExtensionName)' has an unexpected Provisioning State of '$($replicationExtension.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $replicationExtensionName `
+ -VaultName $replicationVaultName `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $replicationExtension) {
+ throw "Unexpected error occurred during Replication Extension creation. Please re-run this command or contact support if help needed."
+ }
+ elseif ($replicationExtension.Property.ProvisioningState -ne [ProvisioningState]::Succeeded) {
+ throw "Replication Extension '$($replicationExtensionName)' has an unexpected Provisioning State of '$($replicationExtension.Property.ProvisioningState)'. Please re-run this command or contact support if help needed."
+ }
+ else {
+ Write-Host "*Selected Replication Extension: '$($replicationExtensionName)'."
+ }
+
+ if ($PassThru) {
+ return $true
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCIDiskMappingObject.ps1 b/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCIDiskMappingObject.ps1
new file mode 100644
index 000000000000..5e73f5696f24
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCIDiskMappingObject.ps1
@@ -0,0 +1,79 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Creates a new disk mapping
+.Description
+The New-AzMigrateHCIDiskMappingObject cmdlet creates a mapping of the source disk attached to the server to be migrated
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratehcidiskmappingobject
+#>
+function New-AzMigrateHCIDiskMappingObject {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput])]
+ [CmdletBinding(PositionalBinding = $false)]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the disk ID of the disk attached to the discovered server to be migrated.
+ ${DiskID},
+
+ [Parameter(Mandatory)]
+ [ValidateSet("true" , "false")]
+ [ArgumentCompleter( { "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies whether the disk contains the Operating System for the source server to be migrated.
+ ${IsOSDisk},
+
+ [Parameter(Mandatory)]
+ [ValidateSet("true" , "false")]
+ [ArgumentCompleter( { "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies whether the disk is dynamic.
+ ${IsDynamic},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int64]
+ # Specifies the disk size in GB.
+ ${Size},
+
+ [Parameter(Mandatory)]
+ [ValidateSet("VHD", "VHDX")]
+ [ArgumentCompleter( { "VHD", "VHDX" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the disk format.
+ ${Format}
+ )
+
+ process {
+ $isDynamicDisk = [System.Convert]::ToBoolean($IsDynamic)
+ $osDisk = [System.Convert]::ToBoolean($IsOSDisk)
+
+ $DiskObject = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput]::new(
+ $DiskID,
+ $isDynamicDisk,
+ $Size,
+ $Format,
+ $osDisk
+ )
+
+ return $DiskObject
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCINicMappingObject.ps1 b/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCINicMappingObject.ps1
new file mode 100644
index 000000000000..5640d529b518
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCINicMappingObject.ps1
@@ -0,0 +1,71 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Creates an object to update NIC properties of a replicating server.
+.Description
+The New-AzMigrateHCINicMappingObject cmdlet creates a mapping of the source NIC attached to the server to be migrated. This object is provided as an input to the Set-AzMigrateServerReplication cmdlet to update the NIC and its properties for a replicating server.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratehcinicmappingobject
+#>
+function New-AzMigrateHCINicMappingObject {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput])]
+ [CmdletBinding(PositionalBinding = $false)]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the ID of the NIC to be updated.
+ ${NicID},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the logical network ARM ID that the VMs will use.
+ ${TargetVirtualSwitchId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the test logical network ARM ID that the VMs will use.
+ ${TargetTestVirtualSwitchId},
+
+ [Parameter()]
+ [ValidateSet("true" , "false")]
+ [ArgumentCompleter( { "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies whether the this Nic should be created at target.
+ ${CreateAtTarget} = "true"
+ )
+
+ process {
+ if (!$PSBoundParameters.ContainsKey('TargetTestVirtualSwitchId')) {
+ $TargetTestVirtualSwitchId = $TargetVirtualSwitchId
+ }
+
+ $selectionTypeForFailover = if ($CreateAtTarget -eq "true") { "SelectedByUser" } else { "NotSelected" }
+
+ $NicObject = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput]::new(
+ $NicID,
+ $TargetVirtualSwitchId,
+ $TargetTestVirtualSwitchId,
+ $selectionTypeForFailover
+ )
+
+ return $NicObject
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCIServerReplication.ps1 b/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCIServerReplication.ps1
new file mode 100644
index 000000000000..01a3870a06ff
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/New-AzMigrateHCIServerReplication.ps1
@@ -0,0 +1,589 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Starts replication for the specified server.
+.Description
+The New-AzMigrateHCIServerReplication cmdlet starts the replication for a particular discovered server in the Azure Migrate project.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratehciserverreplication
+#>
+function New-AzMigrateHCIServerReplication {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+ [CmdletBinding(DefaultParameterSetName = 'ByIdDefaultUser', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
+ param(
+ [Parameter(ParameterSetName = 'ByIdDefaultUser', Mandatory)]
+ [Parameter(ParameterSetName = 'ByIdPowerUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the machine ARM ID of the discovered server to be migrated.
+ ${MachineId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the storage path ARM ID where the VMs will be stored.
+ ${TargetStoragePathId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int32]
+ # Specifies the number of CPU cores.
+ ${TargetVMCPUCore},
+
+ [Parameter(ParameterSetName = 'ByIdDefaultUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the logical network ARM ID that the VMs will use.
+ ${TargetVirtualSwitchId},
+
+ [Parameter(ParameterSetName = 'ByIdDefaultUser')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the test logical network ARM ID that the VMs will use.
+ ${TargetTestVirtualSwitchId},
+
+ [Parameter()]
+ [ValidateSet("true" , "false")]
+ [ArgumentCompleter( { "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies if RAM is dynamic or not.
+ ${IsDynamicMemoryEnabled},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int64]
+ # Specifies the target RAM size in MB.
+ ${TargetVMRam},
+
+ [Parameter(ParameterSetName = 'ByIdPowerUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput[]]
+ # Specifies the disks on the source server to be included for replication.
+ ${DiskToInclude},
+
+ [Parameter(ParameterSetName = 'ByIdPowerUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput[]]
+ # Specifies the NICs on the source server to be included for replication.
+ ${NicToInclude},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the target Resource Group Id where the migrated VM resources will reside.
+ ${TargetResourceGroupId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the name of the VM to be created.
+ ${TargetVMName},
+
+ [Parameter(ParameterSetName = 'ByIdDefaultUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Operating System disk for the source server to be migrated.
+ ${OSDiskID},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
+ Import-Module $PSScriptRoot\Helper\CommonHelper.ps1
+
+ CheckResourceGraphModuleDependency
+ CheckResourcesModuleDependency
+
+ $HasTargetVMCPUCore = $PSBoundParameters.ContainsKey('TargetVMCPUCore')
+ $HasIsDynamicMemoryEnabled = $PSBoundParameters.ContainsKey('IsDynamicMemoryEnabled')
+ if ($HasIsDynamicMemoryEnabled) {
+ $isDynamicRamEnabled = [System.Convert]::ToBoolean($IsDynamicMemoryEnabled)
+ }
+ $HasTargetVMRam = $PSBoundParameters.ContainsKey('TargetVMRam')
+ $HasTargetTestVirtualSwitchId = $PSBoundParameters.ContainsKey('TargetTestVirtualSwitchId')
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ $null = $PSBoundParameters.Remove('TargetVMCPUCore')
+ $null = $PSBoundParameters.Remove('IsDynamicMemoryEnabled')
+ $null = $PSBoundParameters.Remove('TargetVMRam')
+ $null = $PSBoundParameters.Remove('DiskToInclude')
+ $null = $PSBoundParameters.Remove('NicToInclude')
+ $null = $PSBoundParameters.Remove('TargetResourceGroupId')
+ $null = $PSBoundParameters.Remove('TargetVMName')
+ $null = $PSBoundParameters.Remove('TargetVirtualSwitchId')
+ $null = $PSBoundParameters.Remove('TargetTestVirtualSwitchId')
+ $null = $PSBoundParameters.Remove('TargetStoragePathId')
+ $null = $PSBoundParameters.Remove('OSDiskID')
+ $null = $PSBoundParameters.Remove('MachineId')
+ $null = $PSBoundParameters.Remove('WhatIf')
+ $null = $PSBoundParameters.Remove('Confirm')
+
+ $MachineIdArray = $MachineId.Split("/")
+ $SiteType = $MachineIdArray[7]
+ $SiteName = $MachineIdArray[8]
+ $ResourceGroupName = $MachineIdArray[4]
+ $MachineName = $MachineIdArray[10]
+
+ if (($SiteType -ne $SiteTypes.HyperVSites) -and ($SiteType -ne $SiteTypes.VMwareSites)) {
+ throw "Site type is not supported. Site type '$SiteType'. Check MachineId provided."
+ }
+
+ # Get the source site and the discovered machine
+ $null = $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $null = $PSBoundParameters.Add("SiteName", $SiteName)
+ $null = $PSBoundParameters.Add("MachineName", $MachineName)
+
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $instanceType = $AzStackHCIInstanceTypes.HyperVToAzStackHCI
+ $machine = Az.Migrate.Internal\Get-AzMigrateHyperVMachine @PSBoundParameters
+
+ $null = $PSBoundParameters.Remove('MachineName')
+ $siteObject = Az.Migrate.Internal\Get-AzMigrateHyperVSite @PSBoundParameters
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $instanceType = $AzStackHCIInstanceTypes.VMwareToAzStackHCI
+ $machine = Az.Migrate.Internal\Get-AzMigrateMachine @PSBoundParameters
+
+ $null = $PSBoundParameters.Remove('MachineName')
+ $siteObject = Az.Migrate\Get-AzMigrateSite @PSBoundParameters
+ }
+
+ $null = $PSBoundParameters.Remove('ResourceGroupName')
+ $null = $PSBoundParameters.Remove('SiteName')
+
+ if ($null -eq $machine) {
+ throw "No machine '$MachineName' found in resource group '$ResourceGroupName' and site '$SiteName'."
+ }
+
+ if ($siteObject -and ($siteObject.Count -ge 1)) {
+ $ProjectName = $siteObject.DiscoverySolutionId.Split("/")[8]
+ }
+ else {
+ throw "No site '$SiteName' found in resource group '$ResourceGroupName'"
+ }
+
+ # Get the migrate solution.
+ $null = $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $null = $PSBoundParameters.Add("Name", "Servers-Migration-ServerMigration_DataReplication")
+ $null = $PSBoundParameters.Add("MigrateProjectName", $ProjectName)
+
+ $solution = Az.Migrate\Get-AzMigrateSolution @PSBoundParameters
+ $vaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
+
+ $null = $PSBoundParameters.Remove('ResourceGroupName')
+ $null = $PSBoundParameters.Remove("Name")
+ $null = $PSBoundParameters.Remove("MigrateProjectName")
+
+ if (($null -eq $solution) -or [string]::IsNullOrEmpty($vaultName)) {
+ throw 'Azure Migrate Project not configured. Setup Azure Migrate Project and run the Initialize-AzMigrateHCIReplicationInfrastructure script before proceeding.'
+ }
+
+ # Get fabrics and appliances in the project
+ $allFabrics = Az.Migrate\Get-AzMigrateHCIReplicationFabric -ResourceGroupName $ResourceGroupName
+ foreach ($fabric in $allFabrics) {
+ if ($fabric.Property.CustomProperty.MigrationSolutionId -ne $solution.Id) {
+ continue
+ }
+
+ if ($fabric.Property.CustomProperty.InstanceType -ceq $FabricInstanceTypes.HyperVInstance) {
+ $sourceFabric = $fabric
+ }
+ elseif ($fabric.Property.CustomProperty.InstanceType -ceq $FabricInstanceTypes.VmwareInstance) {
+ $sourceFabric = $fabric
+ }
+ elseif ($fabric.Property.CustomProperty.InstanceType -ceq $FabricInstanceTypes.AzStackHCIInstance) {
+ $targetFabric = $fabric
+ }
+ }
+
+ if ($null -eq $sourceFabric) {
+ throw "No connected source appliances are found. Kindly deploy an appliance by completing the Discover step of the migration jounery on the source cluster."
+ }
+
+ if ($null -eq $targetFabric) {
+ throw "A target appliance is not available for the target cluster. Deploy and configure a new appliance for the cluster, or select a different cluster.."
+ }
+
+ # Get Source and Target Dras
+ $sourceDras = Az.Migrate.Internal\Get-AzMigrateDra `
+ -FabricName $sourceFabric.Name `
+ -ResourceGroupName $ResourceGroupName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $sourceDras) {
+ throw "No connected source appliances are found. Kindly deploy an appliance by completing the Discover step of the migration jounery on the source cluster."
+ }
+ $sourceDra = $sourceDras[0]
+
+ $targetDras = Az.Migrate.Internal\Get-AzMigrateDra `
+ -FabricName $targetFabric.Name `
+ -ResourceGroupName $ResourceGroupName `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+ if ($null -eq $targetDras) {
+ throw "A target appliance is not available for the target cluster. Deploy and configure a new appliance for the cluster, or select a different cluster.."
+ }
+ $targetDra = $targetDras[0]
+
+ # Validate Policy
+ $policyName = $vaultName + $instanceType + "policy"
+ $policyObj = Az.Migrate.Internal\Get-AzMigratePolicy `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $policyName `
+ -VaultName $vaultName `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ if ($null -eq $policyObj) {
+ throw "The replication infrastructure is not initialized. Run the Initialize-AzMigrateHCIReplicationInfrastructure script again."
+ }
+
+ # Validate Replication Extension
+ $replicationExtensionName = ($sourceFabric.Id -split '/')[-1] + "-" + ($targetFabric.Id -split '/')[-1] + "-MigReplicationExtn"
+ $replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $replicationExtensionName `
+ -VaultName $vaultName `
+ -SubscriptionId $SubscriptionId `
+ -ErrorVariable notPresent `
+ -ErrorAction SilentlyContinue
+
+ if ($null -eq $replicationExtension) {
+ throw "The replication infrastructure is not initialized. Run the Initialize-AzMigrateHCIReplicationInfrastructure script again."
+ }
+
+ $targetClusterId = $targetFabric.Property.CustomProperty.Cluster.ResourceName
+ $targetClusterIdArray = $targetClusterId.Split("/")
+ $targetSubscription = $targetClusterIdArray[2]
+
+ # Get Target cluster
+ $hciClusterArgQuery = GetHCIClusterARGQuery -HCIClusterID $targetClusterId
+ $targetCluster = Az.ResourceGraph\Search-AzGraph -Query $hciClusterArgQuery -Subscription $targetSubscription
+ if ($null -eq $targetCluster) {
+ throw "Validate target cluster with id '$targetClusterId' exists. Check ARC resource bridge is running on this cluster."
+ }
+
+ # Get source appliance RunAsAccount
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $runAsAccounts = Az.Migrate.Internal\Get-AzMigrateHyperVRunAsAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -SiteName $SiteName `
+ -SubscriptionId $SubscriptionId
+ $runAsAccount = $runAsAccounts | Where-Object { $_.CredentialType -eq $RunAsAccountCredentialTypes.HyperVFabric }
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $runAsAccounts = Az.Migrate\Get-AzMigrateRunAsAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -SiteName $SiteName `
+ -SubscriptionId $SubscriptionId
+ $runAsAccount = $runAsAccounts | Where-Object { $_.CredentialType -eq $RunAsAccountCredentialTypes.VMwareFabric }
+ }
+
+ if ($null -eq $runAsAccount) {
+ throw "No run as account found for site '$SiteName'."
+ }
+
+ # Validate TargetVMName
+ if ($TargetVMName.length -gt 64 -or $TargetVMName.length -eq 0) {
+ throw "The target virtual machine name must be between 1 and 64 characters long."
+ }
+ Import-Module Az.Resources
+ $vmId = $customProperties.TargetResourceGroupId + "/providers/Microsoft.Compute/virtualMachines/" + $TargetVMName
+ $VMNamePresentInRg = Get-AzResource -ResourceId $vmId -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ if ($VMNamePresentInRg) {
+ throw "The target virtual machine name must be unique in the target resource group."
+ }
+
+ if ($TargetVMName -notmatch "^[^_\W][a-zA-Z0-9\-]{0,63}(?+=;,?*@&, whitespace, or begin with '_' or end with '.' or '-'."
+ }
+
+ if (IsReservedOrTrademarked($TargetVMName)) {
+ throw "The target virtual machine name '$TargetVMName' or part of the name is a trademarked or reserved word."
+ }
+
+ $protectedItemProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties]::new()
+ $protectedItemProperties.PolicyName = $policyName
+ $protectedItemProperties.ReplicationExtensionName = $replicationExtensionName
+
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $customProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHCIProtectedItemModelCustomProperties]::new()
+ $isSourceDynamicMemoryEnabled = $machine.IsDynamicMemoryEnabled
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $customProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHCIProtectedItemModelCustomProperties]::new()
+ $isSourceDynamicMemoryEnabled = $false
+ }
+
+ $customProperties.InstanceType = $instanceType
+ $customProperties.CustomLocationRegion = $targetCluster.CustomLocationRegion
+ $customProperties.FabricDiscoveryMachineId = $machine.Id
+ $customProperties.RunAsAccountId = $runAsAccount.Id
+ $customProperties.SourceDraName = $sourceDra.Name
+ $customProperties.StorageContainerId = $TargetStoragePathId
+ $customProperties.TargetArcClusterCustomLocationId = $targetCluster.CustomLocation
+ $customProperties.TargetDraName = $targetDra.Name
+ $customProperties.TargetHciClusterId = $targetClusterId
+ $customProperties.TargetResourceGroupId = $TargetResourceGroupId
+ $customProperties.TargetVMName = $TargetVMName
+ $customProperties.HyperVGeneration = if ($SiteType -eq $SiteTypes.HyperVSites) { $machine.Generation } else { "1" }
+ $customProperties.TargetCpuCore = if ($HasTargetVMCPUCore) { $TargetVMCPUCore } else { $machine.NumberOfProcessorCore }
+ $customProperties.IsDynamicRam = if ($HasIsDynamicMemoryEnabled) { $isDynamicRamEnabled } else { $isSourceDynamicMemoryEnabled }
+
+ # Validate TargetVMRam
+ if ($HasTargetVMRam) {
+ # TargetVMRam needs to be greater than 0
+ if ($TargetVMRam -le 0) {
+ throw "Specify target RAM greater than 0"
+ }
+
+ $customProperties.TargetMemoryInMegaByte = $TargetVMRam
+ }
+ else
+ {
+ $customProperties.TargetMemoryInMegaByte = [System.Math]::Max($machine.AllocatedMemoryInMB, $RAMConfig.MinTargetMemoryInMB)
+ }
+
+ # Construct default dynamic memory config
+ $memoryConfig = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemDynamicMemoryConfig]::new()
+ $memoryConfig.MinimumMemoryInMegaByte = [System.Math]::Min($customProperties.TargetMemoryInMegaByte, $RAMConfig.DefaultMinDynamicMemoryInMB)
+ $memoryConfig.MaximumMemoryInMegaByte = [System.Math]::Max($customProperties.TargetMemoryInMegaByte, $RAMConfig.DefaultMaxDynamicMemoryInMB)
+ $memoryConfig.TargetMemoryBufferPercentage = $RAMConfig.DefaultTargetMemoryBufferPercentage
+
+ $customProperties.DynamicMemoryConfig = $memoryConfig
+
+ # Disks and Nics
+ [PSCustomObject[]]$disks = @()
+ [PSCustomObject[]]$nics = @()
+ if ($parameterSet -match 'DefaultUser') {
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $osDisk = $machine.Disk | Where-Object { $_.InstanceId -eq $OSDiskID }
+ if ($null -eq $osDisk) {
+ throw "No Disk found with InstanceId '$OSDiskID' from discovered machine disks."
+ }
+
+ $diskName = Split-Path $osDisk.Path -leaf
+ if (IsReservedOrTrademarked($diskName)) {
+ throw "The disk name '$diskName' or part of the name is a trademarked or reserved word."
+ }
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $osDisk = $machine.Disk | Where-Object { $_.Uuid -eq $OSDiskID }
+ if ($null -eq $osDisk) {
+ throw "No Disk found with Uuid '$OSDiskID' from discovered machine disks."
+ }
+
+ $diskName = Split-Path $osDisk.Path -leaf
+ if (IsReservedOrTrademarked($diskName)) {
+ throw "The disk name '$diskName' or part of the name is a trademarked or reserved word."
+ }
+ }
+
+ foreach ($sourceDisk in $machine.Disk) {
+ $diskId = if ($SiteType -eq $SiteTypes.HyperVSites) { $sourceDisk.InstanceId } else { $sourceDisk.Uuid }
+ $diskSize = if ($SiteType -eq $SiteTypes.HyperVSites) { $sourceDisk.MaxSizeInByte } else { $sourceDisk.MaxSizeInBytes }
+
+ $DiskObject = [PSCustomObject]@{
+ DiskId = $diskId
+ DiskSizeGb = [long] [Math]::Ceiling($diskSize / 1GB)
+ DiskFileFormat = "VHDX"
+ IsDynamic = $true
+ IsOSDisk = $diskId -eq $OSDiskID
+ }
+
+ $disks += $DiskObject
+ }
+
+ foreach ($sourceNic in $machine.NetworkAdapter) {
+ $NicObject = [PSCustomObject]@{
+ NicId = $sourceNic.NicId
+ TargetNetworkId = $TargetVirtualSwitchId
+ TestNetworkId = if ($HasTargetTestVirtualSwitchId) { $TargetTestVirtualSwitchId } else { $TargetVirtualSwitchId }
+ SelectionTypeForFailover = "SelectedByUser"
+ }
+ $nics += $NicObject
+ }
+ }
+ else {
+ if ($null -eq $DiskToInclude -or $DiskToInclude.length -eq 0) {
+ throw "Invalid DiskToInclude. At least one disk is required."
+ }
+
+ if ($null -eq $NicToInclude -or $NicToInclude.length -eq 0) {
+ throw "Invalid NicToInclude. At least one NIC is required."
+ }
+
+ # Validate OSDisk is set.
+ $osDisk = $DiskToInclude | Where-Object { $_.IsOSDisk }
+ if (($null -eq $osDisk) -or ($osDisk.length -ne 1)) {
+ throw "Invalid DiskToInclude. One and only one disk must be set as OS Disk."
+ }
+
+ # Validate at least one NIC is selected by user.
+ $selectedNics = $NicToInclude | Where-Object { $_.SelectionTypeForFailover -eq "SelectedByUser"}
+ if ($null -eq $selectedNics -or $selectedNics.length -eq 0) {
+ throw "Invalid NicToInclude. At least one NIC is required to be marked as to be created at target."
+ }
+
+ # Validate DiskToInclude
+ [PSCustomObject[]]$uniqueDisks = @()
+ foreach ($disk in $DiskToInclude) {
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $discoveredDisk = $machine.Disk | Where-Object { $_.InstanceId -eq $disk.DiskId }
+ if ($null -eq $discoveredDisk) {
+ throw "No Disk found with InstanceId '$($disk.DiskId)' from discovered machine disks."
+ }
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $discoveredDisk = $machine.Disk | Where-Object { $_.Uuid -eq $disk.DiskId }
+ if ($null -eq $discoveredDisk) {
+ throw "No Disk found with Uuid '$($disk.DiskId)' from discovered machine disks."
+ }
+ }
+
+ $diskName = Split-Path -Path $discoveredDisk.Path -Leaf
+ if (IsReservedOrTrademarked($diskName)) {
+ throw "The disk name '$diskName' or part of the name is a trademarked or reserved word."
+ }
+
+ if ($uniqueDisks.Contains($disk.DiskId)) {
+ throw "The disk id '$($disk.DiskId)' is already taken."
+ }
+ $uniqueDisks += $disk.DiskId
+
+ $htDisk = @{}
+ $disk.PSObject.Properties | ForEach-Object { $htDisk[$_.Name] = $_.Value }
+ $disks += [PSCustomObject]$htDisk
+ }
+
+ # Validate NicToInclude
+ [PSCustomObject[]]$uniqueNics = @()
+ foreach ($nic in $NicToInclude) {
+ $discoveredNic = $machine.NetworkAdapter | Where-Object { $_.NicId -eq $nic.NicId }
+ if ($null -eq $discoveredNic) {
+ throw "The Nic id '$($nic.NicId)' is not found."
+ }
+
+ if ($uniqueNics.Contains($nic.NicId)) {
+ throw "The Nic id '$($nic.NicId)' is already taken."
+ }
+ $uniqueNics += $nic.NicId
+
+ $htNic = @{}
+ $nic.PSObject.Properties | ForEach-Object { $htNic[$_.Name] = $_.Value }
+ $nics += [PSCustomObject]$htNic
+ }
+
+ # Include Nics not added by user as 'NotSelected'
+ $userGivenNicIds = $nics | Select-Object -ExpandProperty NicId
+ $remainingNics = $machine.NetworkAdapter | Where-Object { $_.NicId -notin $userGivenNicIds }
+ foreach ($remainingNic in $remainingNics) {
+ $NicObject = [PSCustomObject]@{
+ NicId = $remainingNic.NicId
+ TargetNetworkId = $nics[0].TargetNetworkId
+ TestNetworkId = $nics[0].TestNetworkId
+ SelectionTypeForFailover = "NotSelected"
+ }
+ $nics += $NicObject
+ }
+ }
+
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $customProperties.DisksToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHCIDiskInput[]]$disks
+ $customProperties.NicsToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHCINicInput[]]$nics
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $customProperties.DisksToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHCIDiskInput[]]$disks
+ $customProperties.NicsToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHCINicInput[]]$nics
+ }
+
+ $protectedItemProperties.CustomProperty = $customProperties
+
+ if ($PSCmdlet.ShouldProcess($MachineId, "Replicate VM.")) {
+ $null = $PSBoundParameters.Add('ResourceGroupName', $ResourceGroupName)
+ $null = $PSBoundParameters.Add('VaultName', $vaultName)
+ $null = $PSBoundParameters.Add('Name', $MachineName)
+ $null = $PSBoundParameters.Add('Property', $protectedItemProperties)
+ $null = $PSBoundParameters.Add('NoWait', $true)
+
+ $operation = Az.Migrate.Internal\New-AzMigrateProtectedItem @PSBoundParameters
+ $jobName = $operation.Target.Split("/")[-1].Split("?")[0]
+
+ $null = $PSBoundParameters.Remove('Name')
+ $null = $PSBoundParameters.Remove('Property')
+ $null = $PSBoundParameters.Remove('NoWait')
+
+ $null = $PSBoundParameters.Add('JobName', $jobName)
+ return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateHCIServerReplication.ps1 b/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateHCIServerReplication.ps1
new file mode 100644
index 000000000000..dee3a73c9f0f
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateHCIServerReplication.ps1
@@ -0,0 +1,153 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Stops replication for the migrated server.
+.Description
+The Remove-AzMigrateHCIServerReplication cmdlet stops the replication for a migrated server.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/remove-azmigratehciserverreplication
+#>
+function Remove-AzMigrateHCIServerReplication {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+ [CmdletBinding(DefaultParameterSetName = 'ByID', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName = 'ByID', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the replcating server for which the replication needs to be disabled. The ID should be retrieved using the Get-AzMigrateHCIServerReplication cmdlet.
+ ${TargetObjectID},
+
+ [Parameter(ParameterSetName = 'ByInputObject', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Specifies the replcating server for which the replication needs to be disabled. The server object can be retrieved using the Get-AzMigrateHCIServerReplication cmdlet.
+ ${InputObject},
+
+ [Parameter()]
+ [ValidateSet("true" , "false")]
+ [ArgumentCompleter( { "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Query')]
+ [System.String]
+ # Specifies whether the replication needs to be force removed. Default to "false".
+ ${ForceRemove} = "false",
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ $shouldForceRemove = [System.Convert]::ToBoolean($ForceRemove)
+ $null = $PSBoundParameters.Remove('ForceRemove')
+ $null = $PSBoundParameters.Remove('TargetObjectID')
+ $null = $PSBoundParameters.Remove('InputObject')
+ $null = $PSBoundParameters.Remove('WhatIf')
+ $null = $PSBoundParameters.Remove('Confirm')
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($parameterSet -eq 'ByInputObject') {
+ $TargetObjectID = $InputObject.Id
+ }
+ $protectedItemIdArray = $TargetObjectID.Split("/")
+ $resourceGroupName = $protectedItemIdArray[4]
+ $vaultName = $protectedItemIdArray[8]
+ $protectedItemName = $protectedItemIdArray[10]
+
+ $null = $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Add("VaultName", $vaultName)
+ $null = $PSBoundParameters.Add("Name", $protectedItemName)
+
+ $protectedItem = Az.Migrate.Internal\Get-AzMigrateProtectedItem @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ if ($null -eq $ProtectedItem)
+ {
+ throw "Replication item is not found with Id '$TargetObjectID'."
+ }
+
+ $null = $PSBoundParameters.Remove('Name')
+
+ if ("DisableProtection" -notin $ProtectedItem.Property.AllowedJob)
+ {
+ throw "Replication item with Id '$TargetObjectID' cannot be removed at this moment. Current protection state is '$($protectedItem.Property.ProtectionStateDescription)'."
+ }
+
+ $null = $PSBoundParameters.Add('ProtectedItemName', $protectedItemName)
+ $null = $PSBoundParameters.Add('NoWait', $true)
+ $null = $PSBoundParameters.Add('ForceDelete', $shouldForceRemove)
+
+ if ($PSCmdlet.ShouldProcess($TargetObjectID, "Stop/Complete VM replication.")) {
+ $operation = Az.Migrate.Internal\Remove-AzMigrateProtectedItem @PSBoundParameters
+ $jobName = $operation.Target.Split("/")[-1].Split("?")[0]
+
+ $null = $PSBoundParameters.Remove('ProtectedItemName')
+ $null = $PSBoundParameters.Remove('NoWait')
+ $null = $PSBoundParameters.Remove('ForceDelete')
+
+ $null = $PSBoundParameters.Add('JobName', $jobName)
+ return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateServerReplication.ps1 b/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateServerReplication.ps1
index 2800eebd7bb5..5825121ca4da 100644
--- a/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateServerReplication.ps1
+++ b/src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateServerReplication.ps1
@@ -28,13 +28,13 @@ function Remove-AzMigrateServerReplication {
[Parameter(ParameterSetName = 'ByIDVMwareCbt', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the replcating server for which the replicatio needs to be disabled. The ID should be retrieved using the Get-AzMigrateServerReplication cmdlet.
+ # Specifies the replcating server for which the replication needs to be disabled. The ID should be retrieved using the Get-AzMigrateServerReplication cmdlet.
${TargetObjectID},
[Parameter(ParameterSetName = 'ByInputObjectVMwareCbt', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IMigrationItem]
- # Specifies the machine object of the replicating server.
+ # Specifies the replcating server for which the replication needs to be disabled. The server object should be retrieved using the Get-AzMigrateServerReplication cmdlet.
${InputObject},
[Parameter()]
diff --git a/src/Migrate/Migrate.Autorest/custom/Set-AzMigrateHCIServerReplication.ps1 b/src/Migrate/Migrate.Autorest/custom/Set-AzMigrateHCIServerReplication.ps1
new file mode 100644
index 000000000000..ced599ff90d4
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Set-AzMigrateHCIServerReplication.ps1
@@ -0,0 +1,328 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Updates the target properties for the replicating server.
+.Description
+The Set-AzMigrateHCIServerReplication cmdlet updates the target properties for the replicating server.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/set-azmigratehciserverreplication
+#>
+function Set-AzMigrateHCIServerReplication {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+ [CmdletBinding(DefaultParameterSetName = 'ById', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the replicating server for which the properties need to be updated. The ID should be retrieved using the Get-AzMigrateHCIServerReplication cmdlet.
+ ${TargetObjectID},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the target VM name.
+ ${TargetVMName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int32]
+ # Specifies the number of CPU cores.
+ ${TargetVMCPUCore},
+
+ [Parameter()]
+ [ValidateSet("true" , "false")]
+ [ArgumentCompleter( { "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies if RAM is dynamic or not.
+ ${IsDynamicMemoryEnabled},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemDynamicMemoryConfig]
+ # Specifies the dynamic memory configration of RAM.
+ ${DynamicMemoryConfig},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int64]
+ # Specifies the target RAM size in MB.
+ ${TargetVMRam},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput[]]
+ # Specifies the nics on the source server to be included for replication.
+ ${NicToInclude},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
+ Import-Module $PSScriptRoot\Helper\CommonHelper.ps1
+
+ CheckResourcesModuleDependency
+
+ $HasTargetVMName = $PSBoundParameters.ContainsKey('TargetVMName')
+ $HasTargetVMCPUCore = $PSBoundParameters.ContainsKey('TargetVMCPUCore')
+ $HasIsDynamicMemoryEnabled = $PSBoundParameters.ContainsKey('IsDynamicMemoryEnabled')
+ if ($HasIsDynamicMemoryEnabled) {
+ $isDynamicRamEnabled = [System.Convert]::ToBoolean($IsDynamicMemoryEnabled)
+ }
+ $HasDynamicMemoryConfig = $PSBoundParameters.ContainsKey('DynamicMemoryConfig')
+ $HasTargetVMRam = $PSBoundParameters.ContainsKey('TargetVMRam')
+ $HasNicToInclude = $PSBoundParameters.ContainsKey('NicToInclude')
+
+ $null = $PSBoundParameters.Remove('TargetVMName')
+ $null = $PSBoundParameters.Remove('TargetVMCPUCore')
+ $null = $PSBoundParameters.Remove('IsDynamicMemoryEnabled')
+ $null = $PSBoundParameters.Remove('DynamicMemoryConfig')
+ $null = $PSBoundParameters.Remove('TargetVMRam')
+ $null = $PSBoundParameters.Remove('NicToInclude')
+ $null = $PSBoundParameters.Remove('TargetObjectID')
+ $null = $PSBoundParameters.Remove('WhatIf')
+ $null = $PSBoundParameters.Remove('Confirm')
+
+ $ProtectedItemIdArray = $TargetObjectID.Split("/")
+ $ResourceGroupName = $ProtectedItemIdArray[4]
+ $VaultName = $ProtectedItemIdArray[8]
+ $MachineName = $ProtectedItemIdArray[10]
+
+ $null = $PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
+ $null = $PSBoundParameters.Add("VaultName", $VaultName)
+ $null = $PSBoundParameters.Add("Name", $MachineName)
+
+ $ProtectedItem = Az.Migrate.Internal\Get-AzMigrateProtectedItem @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ if ($null -eq $ProtectedItem) {
+ throw "Replication item is not found with Id '$TargetObjectID'."
+ }
+
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("VaultName")
+ $null = $PSBoundParameters.Remove("Name")
+
+ $protectedItemProperties = $ProtectedItem.Property
+ $customProperties = $protectedItemProperties.CustomProperty
+ $MachineIdArray = $customProperties.FabricDiscoveryMachineId.Split("/")
+ $SiteType = $MachineIdArray[7]
+
+ if (!$protectedItemProperties.AllowedJob.Contains('PlannedFailover')) {
+ throw "Set server replication is not allowed for this item '$TargetObjectID'."
+ }
+
+ if ($HasTargetVMName) {
+ if ($TargetVMName.length -gt 64 -or $TargetVMName.length -eq 0) {
+ throw "The target virtual machine name must be between 1 and 64 characters long."
+ }
+
+ Import-Module Az.Resources
+ $vmId = $customProperties.TargetResourceGroupId + "/providers/Microsoft.Compute/virtualMachines/" + $TargetVMName
+ $VMNamePresentInRg = Get-AzResource -ResourceId $vmId -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ if ($VMNamePresentInRg) {
+ throw "The target virtual machine name must be unique in the target resource group."
+ }
+
+ if ($TargetVMName -notmatch "^[^_\W][a-zA-Z0-9\-]{0,63}(?+=;,?*@&, whitespace, or begin with '_' or end with '.' or '-'."
+ }
+
+ if (IsReservedOrTrademarked($TargetVMName)) {
+ throw "The target virtual machine name '$TargetVMName' or part of the name is a trademarked or reserved word."
+ }
+
+ $customProperties.TargetVMName = $TargetVMName
+ }
+
+ if ($HasTargetVMCPUCore) {
+ if ($TargetVMCPUCore -le 0) {
+ throw "Specify target CPU core greater than 0"
+ }
+
+ $customProperties.TargetCpuCore = $TargetVMCPUCore
+ }
+
+ # Validate TargetVMRam
+ if ($HasTargetVMRam) {
+ if ($TargetVMRam -le 0) {
+ throw "Specify target RAM greater than 0"
+ }
+
+ $customProperties.TargetMemoryInMegaByte = $TargetVMRam
+ }
+
+ if ($HasIsDynamicMemoryEnabled) {
+ $customProperties.IsDynamicRam = $isDynamicRamEnabled
+ }
+
+ # Dynamic memory enabled & DynamicMemoryConfig supplied
+ if ($customProperties.IsDynamicRam -and $HasDynamicMemoryConfig) {
+ if ($customProperties.TargetMemoryInMegaByte -lt $DynamicMemoryConfig.MinimumMemoryInMegaByte) {
+ throw "DynamicMemoryConfig - Specify minimum memory less than $($customProperties.TargetMemoryInMegaByte)"
+ }
+
+ if ($customProperties.TargetMemoryInMegaByte -gt $DynamicMemoryConfig.MaximumMemoryInMegaByte) {
+ throw "DynamicMemoryConfig - Specify maximum memory greater than $($customProperties.TargetMemoryInMegaByte)"
+ }
+
+ if ($DynamicMemoryConfig.TargetMemoryBufferPercentage -NotIn $RAMConfig.MinTargetMemoryBufferPercentage..$RAMConfig.MaxTargetMemoryBufferPercentage)
+ {
+ throw "DynamicMemoryConfig - Specify target memory buffer percentage between $($RAMConfig.MinTargetMemoryBufferPercentage) % and $($RAMConfig.MaxTargetMemoryBufferPercentage) %."
+ }
+
+ $customProperties.DynamicMemoryConfig = $DynamicMemoryConfig
+ }
+
+ # Dynamic memory is newly enabled and needs a default
+ if ($customProperties.IsDynamicRam -and $null -eq $customProperties.DynamicMemoryConfig) {
+ $memoryConfig = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemDynamicMemoryConfig]::new()
+ $memoryConfig.MinimumMemoryInMegaByte = [System.Math]::Min($customProperties.TargetMemoryInMegaByte, $RAMConfig.DefaultMinDynamicMemoryInMB)
+ $memoryConfig.MaximumMemoryInMegaByte = [System.Math]::Max($customProperties.TargetMemoryInMegaByte, $RAMConfig.DefaultMaxDynamicMemoryInMB)
+ $memoryConfig.TargetMemoryBufferPercentage = $RAMConfig.DefaultTargetMemoryBufferPercentage
+
+ $customProperties.DynamicMemoryConfig = $memoryConfig
+ }
+
+ # Nics
+ [PSCustomObject[]]$nics = @()
+ foreach ($nic in $customProperties.ProtectedNic) {
+ $NicObject = [PSCustomObject]@{
+ NicId = $nic.NicId
+ TargetNetworkId = $nic.TargetNetworkId
+ TestNetworkId = $nic.TestNetworkId
+ SelectionTypeForFailover = $nic.SelectionTypeForFailover
+ }
+
+ $nics += $NicObject
+ }
+
+ if ($HasNicToInclude -and $NicToInclude.length -gt 0) {
+ foreach ($nic in $NicToInclude)
+ {
+ $updatedNic = $nics | Where-Object { $_.NicId -eq $nic.NicId }
+ if ($null -eq $updatedNic){
+ throw "The Nic id '$($nic.NicId)' is not found."
+ }
+
+ $updatedNic.TargetNetworkId = $nic.TargetNetworkId
+ $updatedNic.TestNetworkId = $nic.TestNetworkId
+ $updatedNic.SelectionTypeForFailover = $nic.SelectionTypeForFailover
+ }
+ }
+
+ $selectedNics = $nics | Where-Object { $_.SelectionTypeForFailover -eq "SelectedByUser" }
+ if ($null -eq $selectedNics -or $selectedNics.length -eq 0)
+ {
+ throw "At least one NIC must be selected for creation at target."
+ }
+
+ # Disks
+ [PSCustomObject[]]$disks = @()
+ foreach ($disk in $customProperties.ProtectedDisk) {
+ $DiskObject = [PSCustomObject]@{
+ DiskId = $disk.SourceDiskId
+ DiskSizeGb = [long] [Math]::Ceiling($disk.CapacityInByte/1GB)
+ DiskFileFormat = $disk.DiskType
+ IsDynamic = $disk.IsDynamic
+ IsOSDisk = $disk.IsOSDisk
+ }
+
+ $disks += $DiskObject
+ }
+
+ if ($SiteType -eq $SiteTypes.HyperVSites) {
+ $customProperties.DisksToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHCIDiskInput[]]$disks
+ $customProperties.NicsToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHCINicInput[]]$nics
+ }
+ elseif ($SiteType -eq $SiteTypes.VMwareSites) {
+ $customProperties.DisksToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHCIDiskInput[]]$disks
+ $customProperties.NicsToInclude = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHCINicInput[]]$nics
+ }
+
+ $protectedItemProperties.CustomProperty = $customProperties
+
+ $null = $PSBoundParameters.Add('ResourceGroupName', $ResourceGroupName)
+ $null = $PSBoundParameters.Add('VaultName', $vaultName)
+ $null = $PSBoundParameters.Add('Name', $MachineName)
+ $null = $PSBoundParameters.Add('Property', $protectedItemProperties)
+ $null = $PSBoundParameters.Add('NoWait', $true)
+
+ if ($PSCmdlet.ShouldProcess($TargetObjectID, "Updates VM replication.")) {
+ $operation = Az.Migrate.Internal\New-AzMigrateProtectedItem @PSBoundParameters
+ $jobName = $operation.Target.Split("/")[-1].Split("?")[0]
+
+ $null = $PSBoundParameters.Remove('Name')
+ $null = $PSBoundParameters.Remove('Property')
+ $null = $PSBoundParameters.Remove('NoWait')
+
+ $null = $PSBoundParameters.Add('JobName', $jobName)
+ return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/custom/Start-AzMigrateHCIServerMigration.ps1 b/src/Migrate/Migrate.Autorest/custom/Start-AzMigrateHCIServerMigration.ps1
new file mode 100644
index 000000000000..758f7a9a1087
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/custom/Start-AzMigrateHCIServerMigration.ps1
@@ -0,0 +1,179 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Starts the migration for the replicating server.
+.Description
+Starts the migration for the replicating server.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/start-azmigratehciservermigration
+#>
+function Start-AzMigrateHCIServerMigration {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+ [CmdletBinding(DefaultParameterSetName = 'ByID', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(ParameterSetName = 'ByID', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the replcating server for which migration needs to be initiated. The ID should be retrieved using the Get-AzMigrateHCIServerReplication cmdlet.
+ ${TargetObjectID},
+
+ [Parameter(ParameterSetName = 'ByInputObject', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Specifies the replicating server for which migration needs to be initiated. The server object can be retrieved using the Get-AzMigrateHCIServerReplication cmdlet.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Management.Automation.SwitchParameter]
+ # Specifies whether the source server should be turned off post migration.
+ ${TurnOffSourceServer},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ $performShutDown = $TurnOffSourceServer.IsPresent
+ $null = $PSBoundParameters.Remove('ProjectName')
+ $null = $PSBoundParameters.Remove('MachineName')
+ $null = $PSBoundParameters.Remove('TurnOffSourceServer')
+ $null = $PSBoundParameters.Remove('TargetObjectID')
+ $null = $PSBoundParameters.Remove('ResourceGroupName')
+ $null = $PSBoundParameters.Remove('InputObject')
+ $null = $PSBoundParameters.Remove('WhatIf')
+ $null = $PSBoundParameters.Remove('Confirm')
+
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($parameterSet -eq 'ByInputObject') {
+ $TargetObjectID = $InputObject.Id
+ }
+
+ $protectedItemIdArray = $TargetObjectID.Split("/")
+ $resourceGroupName = $protectedItemIdArray[4]
+ $vaultName = $protectedItemIdArray[8]
+ $protectedItemName = $protectedItemIdArray[10]
+
+ $null = $PSBoundParameters.Add("ResourceGroupName", $resourceGroupName)
+ $null = $PSBoundParameters.Add("VaultName", $vaultName)
+ $null = $PSBoundParameters.Add("Name", $protectedItemName)
+
+ $protectedItem = Az.Migrate.Internal\Get-AzMigrateProtectedItem @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
+ if ($null -eq $protectedItem) {
+ throw "The replicating server doesn't exist. Please check the input and try again."
+ }
+ elseif (
+ (!$protectedItem.Property.AllowedJob.contains("PlannedFailover")) -and
+ (!$ProtectedItem.Property.AllowedJob.contains("Restart"))) {
+ # AllowJob must contains either 'PlannedFailover' or 'Restart' to allow migration
+ throw "The replicating server cannot be migrated right now. Current protection state is '$($protectedItem.Property.ProtectionStateDescription)'."
+ }
+
+ $null = $PSBoundParameters.Remove("ResourceGroupName")
+ $null = $PSBoundParameters.Remove("VaultName")
+ $null = $PSBoundParameters.Remove("Name")
+
+ # Get the instance type from the protected item
+ $instanceType = $protectedItem.Property.CustomProperty.InstanceType
+
+ # Setup PlannedFailover deployment parameters
+ $properties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.PlannedFailoverModelProperties]::new()
+
+ if ($instanceType -eq $AzStackHCIInstanceTypes.HyperVToAzStackHCI) {
+ $customProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.HyperVToAzStackHciPlannedFailoverModelCustomProperties]::new()
+ }
+ elseif ($instanceType -eq $AzStackHCIInstanceTypes.VMwareToAzStackHCI) {
+ $customProperties = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.VMwareToAzStackHciPlannedFailoverModelCustomProperties]::new()
+ }
+ else {
+ throw "Currently, for AzStackHCI scenario, only HyperV and VMware as the source is supported."
+ }
+ $customProperties.InstanceType = $instanceType
+ $customProperties.ShutdownSourceVM = $performShutDown
+ $properties.CustomProperty = $customProperties
+
+ $null = $PSBoundParameters.Add('ResourceGroupName', $resourceGroupName)
+ $null = $PSBoundParameters.Add('VaultName', $vaultName)
+ $null = $PSBoundParameters.Add('ProtectedItemName', $protectedItemName)
+ $null = $PSBoundParameters.Add('NoWait', $true)
+ $null = $PSBoundParameters.Add('Property', $properties)
+
+ if ($PSCmdlet.ShouldProcess($TargetObjectID, "Migrate VM.")) {
+ $operation = Az.Migrate.Internal\Invoke-AzMigratePlannedProtectedItemFailover @PSBoundParameters
+ $jobName = $operation.Target.Split("/")[-1].Split("?")[0]
+
+ $null = $PSBoundParameters.Remove('ProtectedItemName')
+ $null = $PSBoundParameters.Remove('NoWait')
+ $null = $PSBoundParameters.Remove('Property')
+
+ $null = $PSBoundParameters.Add('JobName', $jobName)
+ return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateDiscoveredServer.md b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateDiscoveredServer.md
index 057c447f0b2a..7132e3a08179 100644
--- a/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateDiscoveredServer.md
+++ b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateDiscoveredServer.md
@@ -1,4 +1,4 @@
-### Example 1: List
+### Example 1: List VMware machines
```powershell
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName julytest -ProjectName julytest
```
@@ -20,7 +20,7 @@ idclab-a360-fareast-corp-micros-86617dcf-effe-59ad-8c3a-cdd3ea7300d3_5029cc18-ef
```
Get All servers in a migrate project.
-### Example 2: Get
+### Example 2: Get VMware machine
```powershell
Get-AzMigrateDiscoveredServer -Name idclab-a360-fareast-corp-micros-86617dcf-effe-59ad-8c3a-cdd3ea7300d3_5029e62c-31d2-a6c3-5316-aa39f47c49fc -SubscriptionId xxx-xxx-xxx -ResourceGroupName julytest -ProjectName julytest
```
@@ -33,7 +33,7 @@ idclab-a360-fareast-corp-micros-86617dcf-effe-59ad-8c3a-cdd3ea7300d3_5029e62c-31
```
Get a server in a migrate project by name. Name is a unique paramenter for a server.
-### Example 3: List in an appliance
+### Example 3: List VMware machines in an appliance
```powershell
Get-AzMigrateDiscoveredServer -ApplianceName BBVMwareAVS -SubscriptionId xxx-xxx-xxx -ResourceGroupName julytest -ProjectName julytest
```
@@ -55,7 +55,7 @@ idclab-a360-fareast-corp-micros-86617dcf-effe-59ad-8c3a-cdd3ea7300d3_5029cc18-ef
```
List all servers for an appliance in a project.
-### Example 4: Get in an appliance
+### Example 4: Get VMware machine in an appliance
```powershell
Get-AzMigrateDiscoveredServer -Name idclab-a360-fareast-corp-micros-86617dcf-effe-59ad-8c3a-cdd3ea7300d3_5029e62c-31d2-a6c3-5316-aa39f47c49fc -ApplianceName BBVMwareAVS -SubscriptionId xxx-xxx-xxx -ResourceGroupName julytest -ProjectName julytest
```
@@ -68,7 +68,7 @@ idclab-a360-fareast-corp-micros-86617dcf-effe-59ad-8c3a-cdd3ea7300d3_5029e62c-31
```
Get a server for an appliance in a project. Name is a unique paramenter for a server.
-### Example 5: List and filter by display name
+### Example 5: List and filter VMware machines by display name
```powershell
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName BugBashAVSVMware -ProjectName BugBashAVSVMware -DisplayName Contoso | Format-Table DisplayName,Name,Type
```
@@ -87,7 +87,7 @@ ContosoAppSrv1 10-150-8-52-b090bef3-b733-5e34-bc8f-eb6f2701432a_5
```
List servers in a migrate project and filter responses with display name.
-### Example 6: List in an appliance and filter by display name
+### Example 6: List VMware machines in an appliance and filter by display name
```powershell
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName BugBashAVSVMware -ProjectName BugBashAVSVMware -ApplianceName BBVMwareAVS -DisplayName Contoso | Format-Table DisplayName,Name,Type
```
@@ -106,3 +106,18 @@ Contoso-DataTier3 10-150-8-52-b090bef3-b733-5e34-bc8f-eb6f2701432a_5
```
List servers for an appliance in a migrate project and filter responses with display name.
+### Example 7: List HyperV machines
+```powershell
+Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName "test-rg" -ProjectName "testproj" -SourceMachineType "HyperV" | Format-Table DisplayName,Name,Type
+```
+
+```output
+DisplayName Name Type
+----------- ---- ----
+testvm1 291b6c67-8793-4e21-887e-1e6c3bd00a60 Microsoft.OffAzure/HyperVSites/machines
+testvm2 0fbd6ccb-7133-4e72-b18e-5ec98c9c628f Microsoft.OffAzure/HyperVSites/machines
+testvm3 e6390dfa-6125-431c-871d-f407bdecb571 Microsoft.OffAzure/HyperVSites/machines
+testvm4 af83b64b-2314-48e2-8d0f-fd44ab5142ba Microsoft.OffAzure/HyperVSites/machines
+```
+Get All HyperV servers in a migrate project. Similarly, specify "HyperV" for -SourceMachineType in all the above examples can retrieve HyperV machine(s) in different ways.
+
diff --git a/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIJob.md b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIJob.md
new file mode 100644
index 000000000000..254cc65a71a2
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIJob.md
@@ -0,0 +1,266 @@
+### Example 1: Get by job Id
+```powershell
+Get-AzMigrateHCIJob -ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a
+Name : 0203aa1b-1dff-4653-89a9-b90a76d1601a
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000001
+ObjectInternalId : 13436868-1f4c-5d4e-a252-c666179bf4df
+ObjectInternalName : testmachine1
+ObjectName : testsite-0000-0000-00000001
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/14/2023 7:09:10 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Retrieves a job by its Id.
+
+### Example 2: Get by job name
+```powershell
+Get-AzMigrateHCIJob -ResourceGroupName "test-rg" -ProjectName "testproj" -Name "0203aa1b-1dff-4653-89a9-b90a76d1601a"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a
+Name : 0203aa1b-1dff-4653-89a9-b90a76d1601a
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000001
+ObjectInternalId : 13436868-1f4c-5d4e-a252-c666179bf4df
+ObjectInternalName : testmachine1
+ObjectName : testsite-0000-0000-00000001
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/14/2023 7:09:10 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Retrieves a job by its name.
+
+### Example 3: Get by job input object
+```powershell
+$InputObject = Get-AzMigrateHCIJob -ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a"
+
+Get-AzMigrateHCIJob -InputObject $InputObject
+
+$InputObject | Get-AzMigrateHCIJob
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a
+Name : 0203aa1b-1dff-4653-89a9-b90a76d1601a
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000001
+ObjectInternalId : 13436868-1f4c-5d4e-a252-c666179bf4df
+ObjectInternalName : testmachine1
+ObjectName : testsite-0000-0000-00000001
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/14/2023 7:09:10 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Retrieves a job by the job itself as an input object.
+
+### Example 4: List by resource group Id and project Id.
+```powershell
+Get-AzMigrateHCIJob -ResourceGroupID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg" -ProjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.Migrate/MigrateProjects/testproj"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a
+Name : 0203aa1b-1dff-4653-89a9-b90a76d1601a
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000001
+ObjectInternalId : 13436868-1f4c-5d4e-a252-c666179bf4df
+ObjectInternalName : testmachine1
+ObjectName : testsite-0000-0000-00000001
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/14/2023 7:09:10 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType :
+DisplayName : Planned failover
+EndTime : 8/11/2023 10:09:18 PM
+Error :
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/f2ebb932-fa4a-47a7-b1fa-ff5aa877d5ed
+Name : f2ebb932-fa4a-47a7-b1fa-ff5aa877d5ed
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000000/plannedFailover
+ObjectInternalId : 4ef231a3-0774-5e44-8317-bed903d297a2
+ObjectInternalName : testmachine2
+ObjectName : testsite-0000-0000-00000000
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/11/2023 9:53:48 PM
+State : Succeeded
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task :
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Retrieves all the jobs from a project in some resource group by Ids.
+
+### Example 5: List by resource group name and project name.
+```powershell
+Get-AzMigrateHCIJob -ResourceGroupName "test-rg" -ProjectName "testproj"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a
+Name : 0203aa1b-1dff-4653-89a9-b90a76d1601a
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000001
+ObjectInternalId : 13436868-1f4c-5d4e-a252-c666179bf4df
+ObjectInternalName : testmachine1
+ObjectName : testsite-0000-0000-00000001
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/14/2023 7:09:10 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType :
+DisplayName : Planned failover
+EndTime : 8/11/2023 10:09:18 PM
+Error :
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/f2ebb932-fa4a-47a7-b1fa-ff5aa877d5ed
+Name : f2ebb932-fa4a-47a7-b1fa-ff5aa877d5ed
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/testsite-0000-0000-00000000/plannedFailover
+ObjectInternalId : 4ef231a3-0774-5e44-8317-bed903d297a2
+ObjectInternalName : testmachine2
+ObjectName : testsite-0000-0000-00000000
+ObjectType : ProtectedItem
+ReplicationProviderId : 0a870516-56c7-4460-998c-f267bd579f16
+SourceFabricProviderId : a2793d98-d4f1-427f-a5a6-2d694f4a1bf7
+StartTime : 8/11/2023 9:53:48 PM
+State : Succeeded
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task :
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Retrieves all the jobs from a project in some resource group by names.
+
diff --git a/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIReplicationFabric.md b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIReplicationFabric.md
new file mode 100644
index 000000000000..b6e535a4332c
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIReplicationFabric.md
@@ -0,0 +1,120 @@
+### Example 1: Get by fabric name
+```powershell
+Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg" -Name "testsrcappreplicationfabric"
+```
+
+```output
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationFabrics/testsrcappreplicationfabric
+Location : southeastasia
+Name : testsrcappreplicationfabric
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+SystemDataCreatedAt : 8/11/2023 6:39:04 PM
+SystemDataCreatedBy : testuser@example.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 8/11/2023 6:48:29 PM
+SystemDataLastModifiedBy : testuser@example.com
+SystemDataLastModifiedByType : User
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+Type : Microsoft.DataReplication/replicationFabrics
+```
+
+Retrieves a fabric by its name.
+
+### Example 2: Get by fabric input object
+```powershell
+$InputObject = Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg" -Name "testsrcappreplicationfabric"
+
+Get-AzMigrateHCIReplicationFabric -InputObject $InputObject
+
+$InputObject | Get-AzMigrateHCIReplicationFabric
+```
+
+```output
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationFabrics/testsrcappreplicationfabric
+Location : southeastasia
+Name : testsrcappreplicationfabric
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+SystemDataCreatedAt : 8/11/2023 6:39:04 PM
+SystemDataCreatedBy : testuser@example.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 8/11/2023 6:48:29 PM
+SystemDataLastModifiedBy : testuser@example.com
+SystemDataLastModifiedByType : User
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+Type : Microsoft.DataReplication/replicationFabrics
+```
+
+Retrieves a fabric by the fabric itself as an input object.
+
+### Example 3: List by resource group name
+```powershell
+Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg"
+```
+
+```output
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationFabrics/testsrcappreplicationfabric
+Location : southeastasia
+Name : testsrcappreplicationfabric
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+SystemDataCreatedAt : 8/11/2023 6:39:04 PM
+SystemDataCreatedBy : testuser@example.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 8/11/2023 6:48:29 PM
+SystemDataLastModifiedBy : testuser@example.com
+SystemDataLastModifiedByType : User
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+Type : Microsoft.DataReplication/replicationFabrics
+
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationFabrics/testtgtappreplicationfabric
+Location : southeastasia
+Name : testtgtappreplicationfabric
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+SystemDataCreatedAt : 8/11/2023 9:16:46 PM
+SystemDataCreatedBy : testuser@example.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 8/11/2023 9:16:46 PM
+SystemDataLastModifiedBy : testuser@example.com
+SystemDataLastModifiedByType : User
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+Type : Microsoft.DataReplication/replicationFabrics
+```
+
+Retrieves all fabrics from a resource group by name.
+
+### Example 4: List all fabircs
+```powershell
+Get-AzMigrateHCIReplicationFabric
+```
+
+```output
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationFabrics/testsrcappreplicationfabric
+Location : southeastasia
+Name : testsrcappreplicationfabric
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+SystemDataCreatedAt : 8/11/2023 6:39:04 PM
+SystemDataCreatedBy : testuser@example.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 8/11/2023 6:48:29 PM
+SystemDataLastModifiedBy : testuser@example.com
+SystemDataLastModifiedByType : User
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+Type : Microsoft.DataReplication/replicationFabrics
+
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationFabrics/testtgtappreplicationfabric
+Location : southeastasia
+Name : testtgtappreplicationfabric
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelProperties
+SystemDataCreatedAt : 8/11/2023 9:16:46 PM
+SystemDataCreatedBy : testuser@example.com
+SystemDataCreatedByType : User
+SystemDataLastModifiedAt : 8/11/2023 9:16:46 PM
+SystemDataLastModifiedBy : testuser@example.com
+SystemDataLastModifiedByType : User
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.FabricModelTags
+Type : Microsoft.DataReplication/replicationFabrics
+
+...
+```
+
+Retrieves all fabrics from a subscription.
+
diff --git a/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIServerReplication.md b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIServerReplication.md
new file mode 100644
index 000000000000..65bdf09a18c7
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Get-AzMigrateHCIServerReplication.md
@@ -0,0 +1,77 @@
+### Example 1: Get details by id
+```powershell
+Get-AzMigrateHCIServerReplication -TargetObjectID '/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5'
+```
+
+```output
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5
+Name : 503a4f02-916c-d6b0-8d14-222bbd4767e5
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelTags
+Type : Microsoft.DataReplication/replicationVaults/protectedItems
+```
+
+Get by id.
+
+### Example 2: Get detail by discovered machine id
+```powershell
+Get-AzMigrateHCIServerReplication -DiscoveredMachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/siteName1/machines/503a4f02-916c-d6b0-8d14-222bbd4767e5"
+
+```
+
+```output
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5
+Name : 503a4f02-916c-d6b0-8d14-222bbd4767e5
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelTags
+Type : Microsoft.DataReplication/replicationVaults/protectedItems
+```
+
+Get by discovered machine id.
+
+### Example 3: List all in project by name
+```powershell
+Get-AzMigrateServerReplication -ResourceGroupName testResourceGroup -ProjectName testProjectName
+```
+
+```output
+
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5
+Name : 503a4f02-916c-d6b0-8d14-222bbd4767e5
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelTags
+Type : Microsoft.DataReplication/replicationVaults/protectedItems
+
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/d758f4fb-ae5e-4ac8-bb97-1e114555fe9f
+Name : d758f4fb-ae5e-4ac8-bb97-1e114555fe9f
+Property : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelProperties
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.ProtectedItemModelTags
+Type : Microsoft.DataReplication/replicationVaults/protectedItems
+```
+
+List all.
+
diff --git a/src/Migrate/Migrate.Autorest/examples/Initialize-AzMigrateHCIReplicationInfrastructure.md b/src/Migrate/Migrate.Autorest/examples/Initialize-AzMigrateHCIReplicationInfrastructure.md
new file mode 100644
index 000000000000..85c987e3b80b
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Initialize-AzMigrateHCIReplicationInfrastructure.md
@@ -0,0 +1,24 @@
+### Example 1: Initialize AzStackHCI replication infrastructure
+```powershell
+Initialize-AzMigrateHCIReplicationInfrastructure -ProjectName "testproj" -ResourceGroupName "test-rg" -SourceApplianceName "testsrcapp" -TargetApplianceName "testtgtapp" -PassThru:$true
+```
+
+```output
+$true
+```
+
+Initialize AzStackHCI replication infrastructure. Cache storage account, replication policy, and replication extension will be created automatically.
+
+### Example 2: Initialize AzStackHCI replication infrastructure with custom cache storage account
+```powershell
+$cacheStorageAccountId = "/subscriptions/xxx-xxx-xxxx/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/testSa"
+
+Initialize-AzMigrateHCIReplicationInfrastructure -ProjectName "testproj" -ResourceGroupName "test-rg" -CacheStorageAccountId $cacheStorageAccountId -SourceApplianceName "testsrcapp" -TargetApplianceName "testtgtapp" -PassThru:$true
+```
+
+```output
+$true
+```
+
+Initialize AzStackHCI replication infrastructure with custom cache storage account. Replication policy and replication extension will be created automatically.
+
diff --git a/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCIDiskMappingObject.md b/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCIDiskMappingObject.md
new file mode 100644
index 000000000000..b0a8a4308257
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCIDiskMappingObject.md
@@ -0,0 +1,15 @@
+### Example 1: Creates Disk to migrate
+```powershell
+New-AzMigrateHCIDiskMappingObject -DiskID a -IsOSDisk true -IsDynamic true -Size 1 -Format VHDX
+```
+
+```output
+DiskFileFormat : VHDX
+DiskId : a
+DiskSizeGb : 1
+IsDynamic : True
+IsOSDisk : True
+StorageContainerId :
+```
+
+Get disk object to provide input for New-AzMigrateHCIServerReplication
diff --git a/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCINicMappingObject.md b/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCINicMappingObject.md
new file mode 100644
index 000000000000..80b827be203a
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCINicMappingObject.md
@@ -0,0 +1,12 @@
+### Example 1: Create NIC to migrate
+```powershell
+New-AzMigrateHCINicMappingObject -NicID a -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external"
+```
+
+```output
+NicId : a
+TargetNetworkId : /subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external
+TestNetworkId : /subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external
+SelectionTypeForFailover : SelectedByUser
+```
+Get NIC object to provide input for New-AzMigrateHCIServerReplication and Set-AzMigrateHCIServerReplication
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCIServerReplication.md b/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCIServerReplication.md
new file mode 100644
index 000000000000..aa0a5ca63c2c
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/New-AzMigrateHCIServerReplication.md
@@ -0,0 +1,85 @@
+### Example 1: When there is only OS disk to migrate
+```powershell
+New-AzMigrateHCIServerReplication -MachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/testsrc7972site/machines/005-005-005" -OSDiskID "Microsoft:0EC082D5-6827-457A-BAE2-F986E1B94851\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -TargetStoragePathId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/storagecontainers/testStorageContainer1" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external" -TargetResourceGroupId "/subscriptions//xxx-xxx-xxx/resourceGroups/target-rg"-TargetVMName "targetVM"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Create or update protected item
+EndTime : 1/1/1900 8:54:47 PM
+Error : {}
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/jobs/f2d3430a-2977-419f-abd5-11d171e17f5e
+Name : f2d3430a-2977-419f-abd5-11d171e17f5e
+ObjectId : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94555
+ObjectInternalId : a8b5ee68-102c-5aae-9499-c57a475a8fd4
+ObjectInternalName : test_vm
+ObjectName : 0ec082d5-6827-457a-bae2-f986e1b94555
+ObjectType : ProtectedItem
+ReplicationProviderId : xxx-xxx-xxx
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 1/1/1900 8:49:27 PM
+State : Succeeded
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+This is for the scenario, when there is only one single disk that has to be protected.
+
+### Example 2: When there are multiple disks or NICs to migrate
+```powershell
+[AzStackHCIDiskInput[]]$DisksToInclude = @()
+$OSDisk = New-AzMigrateHCIDiskMappingObject -DiskID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -IsOSDisk true -IsDynamic true -Size 42 -Format VHD
+$DataDisk = New-AzMigrateHCIDiskMappingObject -DiskID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\C92FAB89-DA8B-47E9-92F3-364642ECDF39\0\0\L" -IsOSDisk false -IsDynamic true -Size 5 -Format VHD
+$DisksToInclude += $OSDisk
+$DisksToInclude += $DataDisk
+
+[AzStackHCINicInput[]]$NicsToInclude = @()
+$Nic = New-AzMigrateHCINicMappingObject -NicID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\99CDFD2E-D60C-4218-AC2E-E7C2D8253EB9" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external"
+$NicsToInclude += $Nic
+
+New-AzMigrateHCIServerReplication -MachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/testsrc7972site/machines/005-005-005" -TargetStoragePathId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/storagecontainers/testStorageContainer1" -TargetResourceGroupId "/subscriptions//xxx-xxx-xxx/resourceGroups/target-rg"-TargetVMName "targetVM" -DiskToInclude $DisksToInclude -NicToInclude $NicsToInclude
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Create or update protected item
+EndTime : 1/1/1900 2:27:14 PM
+Error : {}
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/jobs/f855305c-5bed-4bc6-996e-d273115ab833
+Name : f855305c-5bed-4bc6-996e-d273115ab833
+ObjectId : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
+ObjectInternalId : a40ecd8e-6413-574d-b1f8-2ef925e087fc
+ObjectInternalName : test_vm
+ObjectName : c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
+ObjectType : ProtectedItem
+ReplicationProviderId : 4de0fddc-bdfe-40d9-b60e-678bdce89630
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 1/1/1900 2:21:50 PM
+State : Succeeded
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+This is for the scenario, when there are multiple disks that has to be protected.
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/examples/Remove-AzMigrateHCIServerReplication.md b/src/Migrate/Migrate.Autorest/examples/Remove-AzMigrateHCIServerReplication.md
new file mode 100644
index 000000000000..350684702d94
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Remove-AzMigrateHCIServerReplication.md
@@ -0,0 +1,80 @@
+### Example 1: Remove replication by Id
+```powershell
+Remove-AzMigrateHCIServerReplication -TargetObjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94851"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/2b0b356e-d106-43af-ad26-02631fcaebba
+Name : 2b0b356e-d106-43af-ad26-02631fcaebba
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/protectedItems/c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
+ObjectInternalId : a40ecd8e-6413-574d-b1f8-2ef925e087fc
+ObjectInternalName : testmachine
+ObjectName : c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
+ObjectType : ProtectedItem
+ReplicationProviderId : 4de0fddc-bdfe-40d9-b60e-678bdce89630
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 7/25/2023 10:14:42 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Remove AzStackHCI replication by Id.
+
+### Example 2: Remove replication by input object
+```powershell
+$InputObject = Get-AzMigrateHCIServerReplication -TargetObjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94851"
+
+Remove-AzMigrateHCIServerReplication -InputObject $InputObject
+
+$InputObject | Remove-AzMigrateHCIServerReplication
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Delete protected item
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/2b0b356e-d106-43af-ad26-02631fcaebba
+Name : 2b0b356e-d106-43af-ad26-02631fcaebba
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/protectedItems/c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
+ObjectInternalId : a40ecd8e-6413-574d-b1f8-2ef925e087fc
+ObjectInternalName : testmachine
+ObjectName : c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
+ObjectType : ProtectedItem
+ReplicationProviderId : 4de0fddc-bdfe-40d9-b60e-678bdce89630
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 7/25/2023 10:14:42 PM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Deleting protected item}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Remove AzStackHCI replication by replication input object.
+
diff --git a/src/Migrate/Migrate.Autorest/examples/Set-AzMigrateHCIServerReplication.md b/src/Migrate/Migrate.Autorest/examples/Set-AzMigrateHCIServerReplication.md
new file mode 100644
index 000000000000..3d98be732f89
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Set-AzMigrateHCIServerReplication.md
@@ -0,0 +1,81 @@
+### Example 1: Update target VM name
+```powershell
+Set-AzMigrateHCIServerReplication -TargetObjectID '/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5' -TargetVMName "targetName1"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Create or update protected item
+EndTime : 1/1/1900 8:54:47 PM
+Error : {}
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/jobs/f2d3430a-2977-419f-abd5-11d171e17f5e
+Name : f2d3430a-2977-419f-abd5-11d171e17f5e
+ObjectId : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94555
+ObjectInternalId : a8b5ee68-102c-5aae-9499-c57a475a8fd4
+ObjectInternalName : test_vm
+ObjectName : 0ec082d5-6827-457a-bae2-f986e1b94555
+ObjectType : ProtectedItem
+ReplicationProviderId : xxx-xxx-xxx
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 1/1/1900 8:49:27 PM
+State : Succeeded
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Update target VM name
+
+### Example 2: Update dynamic memory configuration
+```powershell
+$memoryConfig = [PSCustomObject]@{
+ MinimumMemoryInMegaByte = 1024
+ MaximumMemoryInMegaByte = 34816
+ TargetMemoryBufferPercentage = 20
+}
+
+Set-AzMigrateHCIServerReplication -TargetObjectID '/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5' -DynamicMemoryConfig $memoryConfig
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
+CustomPropertyInstanceType : WorkflowDetails
+DisplayName : Create or update protected item
+EndTime : 1/1/1900 8:54:47 PM
+Error : {}
+Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/jobs/f2d3430a-2977-419f-abd5-11d171e17f5e
+Name : f2d3430a-2977-419f-abd5-11d171e17f5e
+ObjectId : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94555
+ObjectInternalId : a8b5ee68-102c-5aae-9499-c57a475a8fd4
+ObjectInternalName : test_vm
+ObjectName : 0ec082d5-6827-457a-bae2-f986e1b94555
+ObjectType : ProtectedItem
+ReplicationProviderId : xxx-xxx-xxx
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 1/1/1900 8:49:27 PM
+State : Succeeded
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Update dynamic memory configuration.
\ No newline at end of file
diff --git a/src/Migrate/Migrate.Autorest/examples/Start-AzMigrateHCIServerMigration.md b/src/Migrate/Migrate.Autorest/examples/Start-AzMigrateHCIServerMigration.md
new file mode 100644
index 000000000000..58fcc3abc477
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/examples/Start-AzMigrateHCIServerMigration.md
@@ -0,0 +1,94 @@
+### Example 1: Start migration by Id
+```powershell
+Start-AzMigrateHCIServerMigration -TargetObjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94851"
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api2021
+ 0216Preview.WorkflowModelCustomPropertiesAffectedObjectDe
+ tails
+CustomPropertyInstanceType : FailoverWorkflowDetails
+DisplayName : Planned failover
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/af0e1bf6-e3e6-482c-8345-b1a06d87af96
+Name : af0e1bf6-e3e6-482c-8345-b1a06d87af96
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94851/plannedFai
+ lover
+ObjectInternalId : a8b5ee68-102c-5aae-9499-c57a475a8fc4
+ObjectInternalName : testmachine
+ObjectName : 0ec082d5-6827-457a-bae2-f986e1b94851
+ObjectType : ProtectedItem
+ReplicationProviderId : 4de0fddc-bdfe-40d9-b60e-678bdce89630
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 8/1/2023 12:42:19 AM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api2021
+ 0216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Turning off resource on primary,
+ Starting failover, Preparing protected entities...}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Start AzStackHCI server migration by Id.
+
+### Example 2: Start migration by input object
+```powershell
+$InputObject = Get-AzMigrateHCIServerReplication -TargetObjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94851"
+
+Start-AzMigrateHCIServerMigration -InputObject $InputObject
+
+$InputObject | Start-AzMigrateHCIServerMigration
+```
+
+```output
+ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
+AllowedAction : {Cancel}
+CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api2021
+ 0216Preview.WorkflowModelCustomPropertiesAffectedObjectDe
+ tails
+CustomPropertyInstanceType : FailoverWorkflowDetails
+DisplayName : Planned failover
+EndTime :
+Error : {}
+Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/jobs/af0e1bf6-e3e6-482c-8345-b1a06d87af96
+Name : af0e1bf6-e3e6-482c-8345-b1a06d87af96
+ObjectId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication
+ /replicationVaults/testproj1234replicationvault/protectedItems/0ec082d5-6827-457a-bae2-f986e1b94851/plannedFai
+ lover
+ObjectInternalId : a8b5ee68-102c-5aae-9499-c57a475a8fc4
+ObjectInternalName : testmachine
+ObjectName : 0ec082d5-6827-457a-bae2-f986e1b94851
+ObjectType : ProtectedItem
+ReplicationProviderId : 4de0fddc-bdfe-40d9-b60e-678bdce89630
+SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
+StartTime : 8/1/2023 12:42:19 AM
+State : Started
+SystemDataCreatedAt :
+SystemDataCreatedBy :
+SystemDataCreatedByType :
+SystemDataLastModifiedAt :
+SystemDataLastModifiedBy :
+SystemDataLastModifiedByType :
+Tag : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api2021
+ 0216Preview.WorkflowModelTags
+TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
+Task : {Prerequisite check, Turning off resource on primary,
+ Starting failover, Preparing protected entities...}
+Type : Microsoft.DataReplication/replicationVaults/jobs
+```
+
+Start AzStackHCI server migration by replication input object.
+
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateDiscoveredServer.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateDiscoveredServer.ps1
index 76eee6f9c4ce..088fdb4113ef 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateDiscoveredServer.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateDiscoveredServer.ps1
@@ -31,14 +31,18 @@ Get-AzMigrateDiscoveredServer -Name idclab-a360-fareast-corp-micros-86617dcf-eff
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName BugBashAVSVMware -ProjectName BugBashAVSVMware -DisplayName Contoso | Format-Table DisplayName,Name,Type
.Example
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName BugBashAVSVMware -ProjectName BugBashAVSVMware -ApplianceName BBVMwareAVS -DisplayName Contoso | Format-Table DisplayName,Name,Type
+.Example
+Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName "test-rg" -ProjectName "testproj" -SourceMachineType "HyperV" | Format-Table DisplayName,Name,Type
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IHyperVMachine
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine
.Link
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratediscoveredserver
#>
function Get-AzMigrateDiscoveredServer {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine], [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IHyperVMachine])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -57,9 +61,17 @@ param(
[Parameter(ParameterSetName='ListInSite')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the VMware machine display name.
+ # Specifies the source machine display name.
${DisplayName},
+ [Parameter()]
+ [ArgumentCompleter({ "VMware", "HyperV" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the source machine type.
+ # Currently, only HyperV and VMware are supported.
+ ${SourceMachineType},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
@@ -71,7 +83,7 @@ param(
[Parameter(ParameterSetName='Get', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the VMware machine name.
+ # Specifies the source machine name.
# This is an internal Name.
# For users, use display name.
${Name},
@@ -121,6 +133,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIJob.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIJob.ps1
new file mode 100644
index 000000000000..f4fa8e862ee6
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIJob.ps1
@@ -0,0 +1,282 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Retrieves the status of an Azure Migrate job.
+.Description
+The Get-AzMigrateHCIJob cmdlet retrives the status of an Azure Migrate job.
+.Example
+Get-AzMigrateHCIJob -ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a"
+.Example
+Get-AzMigrateHCIJob -ResourceGroupName "test-rg" -ProjectName "testproj" -Name "0203aa1b-1dff-4653-89a9-b90a76d1601a"
+.Example
+$InputObject = Get-AzMigrateHCIJob -ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a"
+
+Get-AzMigrateHCIJob -InputObject $InputObject
+
+$InputObject | Get-AzMigrateHCIJob
+.Example
+Get-AzMigrateHCIJob -ResourceGroupID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg" -ProjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.Migrate/MigrateProjects/testproj"
+.Example
+Get-AzMigrateHCIJob -ResourceGroupName "test-rg" -ProjectName "testproj"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Specifies the job object of the replicating server.
+ [AccountName ]: Run as account ARM name.
+ [AlertSettingName ]: The name of the email notification configuration.
+ [ClusterName ]: Cluster ARM name.
+ [DatabaseInstanceName ]: Unique name of a database instance in Azure migration hub.
+ [DatabaseName ]: Unique name of a database in Azure migration hub.
+ [DeploymentId ]: Deployment Id.
+ [EmailConfigurationName ]: The email configuration name.
+ [EventName ]: Unique name of an event within a migrate project.
+ [FabricAgentName ]: The fabric agent (Dra) name.
+ [FabricName ]: Fabric name.
+ [HostName ]: Host ARM name.
+ [Id ]: Resource identity path
+ [IntentObjectName ]: Replication protection intent name.
+ [JobName ]: Job ARM name.
+ [Location ]: The name of the Azure region.
+ [LogicalNetworkName ]: Logical network name.
+ [MachineName ]: Machine ARM name.
+ [MappingName ]: Protection Container mapping name.
+ [MigrateProjectName ]: Name of the Azure Migrate project.
+ [MigrationItemName ]: Migration item name.
+ [MigrationRecoveryPointName ]: The migration recovery point name.
+ [NetworkMappingName ]: Network mapping name.
+ [NetworkName ]: Primary network name.
+ [OperationId ]: The ID of an ongoing async operation.
+ [OperationStatusName ]: Operation status ARM name.
+ [PolicyName ]: Replication policy name.
+ [ProtectableItemName ]: Protectable item name.
+ [ProtectedItemName ]: The protected item name.
+ [ProtectionContainerName ]: Protection container name.
+ [ProviderName ]: Recovery services provider name.
+ [RecoveryPlanName ]: Name of the recovery plan.
+ [RecoveryPointName ]: The recovery point name.
+ [ReplicatedProtectedItemName ]: Replication protected item name.
+ [ReplicationExtensionName ]: The replication extension name.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ResourceName ]: The name of the recovery services vault.
+ [SiteName ]: Site name.
+ [SolutionName ]: Unique name of a migration solution within a migrate project.
+ [StorageClassificationMappingName ]: Storage classification mapping name.
+ [StorageClassificationName ]: Storage classification name.
+ [SubscriptionId ]: The ID of the target subscription.
+ [VaultName ]: The vault name.
+ [VaultSettingName ]: Vault setting name.
+ [VcenterName ]: VCenter ARM name.
+ [VirtualMachineName ]: Virtual Machine name.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcijob
+#>
+function Get-AzMigrateHCIJob {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+[CmdletBinding(DefaultParameterSetName='ListByName', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='ListByName', Mandatory)]
+ [Parameter(ParameterSetName='GetByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The name of the resource group where the recovery services vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ListByName', Mandatory)]
+ [Parameter(ParameterSetName='GetByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The name of the migrate project.
+ ${ProjectName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the job id for which the details needs to be retrieved.
+ ${ID},
+
+ [Parameter(ParameterSetName='GetByName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Job identifier
+ ${Name},
+
+ [Parameter(ParameterSetName='GetByInputObject', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Specifies the job object of the replicating server.
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupID},
+
+ [Parameter(ParameterSetName='ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Azure Migrate Project in which servers are replicating.
+ ${ProjectID},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ ListByName = 'Az.Migrate.custom\Get-AzMigrateHCIJob';
+ GetById = 'Az.Migrate.custom\Get-AzMigrateHCIJob';
+ GetByName = 'Az.Migrate.custom\Get-AzMigrateHCIJob';
+ GetByInputObject = 'Az.Migrate.custom\Get-AzMigrateHCIJob';
+ ListById = 'Az.Migrate.custom\Get-AzMigrateHCIJob';
+ }
+ if (('ListByName', 'GetById', 'GetByName', 'GetByInputObject', 'ListById') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIReplicationFabric.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIReplicationFabric.ps1
new file mode 100644
index 000000000000..d62fdcde7819
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIReplicationFabric.ps1
@@ -0,0 +1,266 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets the details of the fabric.
+.Description
+Gets the details of the fabric.
+.Example
+Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg" -Name "testsrcappreplicationfabric"
+.Example
+$InputObject = Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg" -Name "testsrcappreplicationfabric"
+
+Get-AzMigrateHCIReplicationFabric -InputObject $InputObject
+
+$InputObject | Get-AzMigrateHCIReplicationFabric
+.Example
+Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg"
+.Example
+Get-AzMigrateHCIReplicationFabric
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IFabricModel
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [AccountName ]: Run as account ARM name.
+ [AlertSettingName ]: The name of the email notification configuration.
+ [ClusterName ]: Cluster ARM name.
+ [DatabaseInstanceName ]: Unique name of a database instance in Azure migration hub.
+ [DatabaseName ]: Unique name of a database in Azure migration hub.
+ [DeploymentId ]: Deployment Id.
+ [EmailConfigurationName ]: The email configuration name.
+ [EventName ]: Unique name of an event within a migrate project.
+ [FabricAgentName ]: The fabric agent (Dra) name.
+ [FabricName ]: Fabric name.
+ [HostName ]: Host ARM name.
+ [Id ]: Resource identity path
+ [IntentObjectName ]: Replication protection intent name.
+ [JobName ]: Job ARM name.
+ [Location ]: The name of the Azure region.
+ [LogicalNetworkName ]: Logical network name.
+ [MachineName ]: Machine ARM name.
+ [MappingName ]: Protection Container mapping name.
+ [MigrateProjectName ]: Name of the Azure Migrate project.
+ [MigrationItemName ]: Migration item name.
+ [MigrationRecoveryPointName ]: The migration recovery point name.
+ [NetworkMappingName ]: Network mapping name.
+ [NetworkName ]: Primary network name.
+ [OperationId ]: The ID of an ongoing async operation.
+ [OperationStatusName ]: Operation status ARM name.
+ [PolicyName ]: Replication policy name.
+ [ProtectableItemName ]: Protectable item name.
+ [ProtectedItemName ]: The protected item name.
+ [ProtectionContainerName ]: Protection container name.
+ [ProviderName ]: Recovery services provider name.
+ [RecoveryPlanName ]: Name of the recovery plan.
+ [RecoveryPointName ]: The recovery point name.
+ [ReplicatedProtectedItemName ]: Replication protected item name.
+ [ReplicationExtensionName ]: The replication extension name.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ResourceName ]: The name of the recovery services vault.
+ [SiteName ]: Site name.
+ [SolutionName ]: Unique name of a migration solution within a migrate project.
+ [StorageClassificationMappingName ]: Storage classification mapping name.
+ [StorageClassificationName ]: Storage classification name.
+ [SubscriptionId ]: The ID of the target subscription.
+ [VaultName ]: The vault name.
+ [VaultSettingName ]: Vault setting name.
+ [VcenterName ]: VCenter ARM name.
+ [VirtualMachineName ]: Virtual Machine name.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcireplicationfabric
+#>
+function Get-AzMigrateHCIReplicationFabric {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IFabricModel])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('FabricName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The fabric name.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription Id in which migrate project was created.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Query')]
+ [System.String]
+ # Continuation token from the previous call.
+ ${ContinuationToken},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_Get';
+ GetViaIdentity = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_GetViaIdentity';
+ List = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_List';
+ List1 = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIServerReplication.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIServerReplication.ps1
new file mode 100644
index 000000000000..e17c6eccf699
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateHCIServerReplication.ps1
@@ -0,0 +1,282 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Retrieves the details of the replicating server.
+.Description
+The Get-AzMigrateHCIServerReplication cmdlet retrieves the object for the replicating server.
+.Example
+Get-AzMigrateHCIServerReplication -TargetObjectID '/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/503a4f02-916c-d6b0-8d14-222bbd4767e5'
+.Example
+Get-AzMigrateHCIServerReplication -DiscoveredMachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/siteName1/machines/503a4f02-916c-d6b0-8d14-222bbd4767e5"
+
+.Example
+Get-AzMigrateServerReplication -ResourceGroupName testResourceGroup -ProjectName testProjectName
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IProtectedItemModel
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Specifies the machine object of the replicating server.
+ [AccountName ]: Run as account ARM name.
+ [AlertSettingName ]: The name of the email notification configuration.
+ [ClusterName ]: Cluster ARM name.
+ [DatabaseInstanceName ]: Unique name of a database instance in Azure migration hub.
+ [DatabaseName ]: Unique name of a database in Azure migration hub.
+ [DeploymentId ]: Deployment Id.
+ [EmailConfigurationName ]: The email configuration name.
+ [EventName ]: Unique name of an event within a migrate project.
+ [FabricAgentName ]: The fabric agent (Dra) name.
+ [FabricName ]: Fabric name.
+ [HostName ]: Host ARM name.
+ [Id ]: Resource identity path
+ [IntentObjectName ]: Replication protection intent name.
+ [JobName ]: Job ARM name.
+ [Location ]: The name of the Azure region.
+ [LogicalNetworkName ]: Logical network name.
+ [MachineName ]: Machine ARM name.
+ [MappingName ]: Protection Container mapping name.
+ [MigrateProjectName ]: Name of the Azure Migrate project.
+ [MigrationItemName ]: Migration item name.
+ [MigrationRecoveryPointName ]: The migration recovery point name.
+ [NetworkMappingName ]: Network mapping name.
+ [NetworkName ]: Primary network name.
+ [OperationId ]: The ID of an ongoing async operation.
+ [OperationStatusName ]: Operation status ARM name.
+ [PolicyName ]: Replication policy name.
+ [ProtectableItemName ]: Protectable item name.
+ [ProtectedItemName ]: The protected item name.
+ [ProtectionContainerName ]: Protection container name.
+ [ProviderName ]: Recovery services provider name.
+ [RecoveryPlanName ]: Name of the recovery plan.
+ [RecoveryPointName ]: The recovery point name.
+ [ReplicatedProtectedItemName ]: Replication protected item name.
+ [ReplicationExtensionName ]: The replication extension name.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ResourceName ]: The name of the recovery services vault.
+ [SiteName ]: Site name.
+ [SolutionName ]: Unique name of a migration solution within a migrate project.
+ [StorageClassificationMappingName ]: Storage classification mapping name.
+ [StorageClassificationName ]: Storage classification name.
+ [SubscriptionId ]: The ID of the target subscription.
+ [VaultName ]: The vault name.
+ [VaultSettingName ]: Vault setting name.
+ [VcenterName ]: VCenter ARM name.
+ [VirtualMachineName ]: Virtual Machine name.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehciserverreplication
+#>
+function Get-AzMigrateHCIServerReplication {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IProtectedItemModel])]
+[CmdletBinding(DefaultParameterSetName='ListByName', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='ListByName', Mandatory)]
+ [Parameter(ParameterSetName='GetByMachineName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ListByName', Mandatory)]
+ [Parameter(ParameterSetName='GetByMachineName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Azure Migrate project in the current subscription.
+ ${ProjectName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetByItemID', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the replicating server ARM ID.
+ ${TargetObjectID},
+
+ [Parameter(ParameterSetName='GetByMachineName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the display name of the replicating machine.
+ ${MachineName},
+
+ [Parameter(ParameterSetName='GetBySDSID', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the machine ID of the discovered server.
+ ${DiscoveredMachineId},
+
+ [Parameter(ParameterSetName='GetByInputObject', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Specifies the machine object of the replicating server.
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupID},
+
+ [Parameter(ParameterSetName='ListById', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Azure Migrate Project in which servers are replicating.
+ ${ProjectID},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ ListByName = 'Az.Migrate.custom\Get-AzMigrateHCIServerReplication';
+ GetByItemID = 'Az.Migrate.custom\Get-AzMigrateHCIServerReplication';
+ GetByMachineName = 'Az.Migrate.custom\Get-AzMigrateHCIServerReplication';
+ GetBySDSID = 'Az.Migrate.custom\Get-AzMigrateHCIServerReplication';
+ GetByInputObject = 'Az.Migrate.custom\Get-AzMigrateHCIServerReplication';
+ ListById = 'Az.Migrate.custom\Get-AzMigrateHCIServerReplication';
+ }
+ if (('ListByName', 'GetByItemID', 'GetByMachineName', 'GetBySDSID', 'GetByInputObject', 'ListById') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateJob.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateJob.ps1
index 4986390747c7..4b774b830749 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateJob.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateJob.ps1
@@ -228,6 +228,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateProject.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateProject.ps1
index fcbeb3fa4796..9d3687679696 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateProject.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateProject.ps1
@@ -133,6 +133,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationFabric.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationFabric.ps1
index 35df6abe983d..ca146dfc2f75 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationFabric.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationFabric.ps1
@@ -147,6 +147,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationPolicy.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationPolicy.ps1
index d11dfeabc051..ff3d83cebb58 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationPolicy.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationPolicy.ps1
@@ -141,6 +141,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainer.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainer.ps1
index beb84aebc12a..531deb66c2fb 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainer.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainer.ps1
@@ -149,6 +149,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainerMapping.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainerMapping.ps1
index ada3ecdb3188..e87926c41108 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainerMapping.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationProtectionContainerMapping.ps1
@@ -154,6 +154,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationRecoveryServicesProvider.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationRecoveryServicesProvider.ps1
index ba328d3565b0..a57d42d0c6a8 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationRecoveryServicesProvider.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateReplicationRecoveryServicesProvider.ps1
@@ -145,6 +145,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateRunAsAccount.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateRunAsAccount.ps1
index 437f2e73befa..5d81e23cf87b 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateRunAsAccount.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateRunAsAccount.ps1
@@ -142,6 +142,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateServerReplication.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateServerReplication.ps1
index 6d96893fcd0b..24ee7e808008 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateServerReplication.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateServerReplication.ps1
@@ -202,6 +202,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSite.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSite.ps1
index eb3d440946ee..d96debd94796 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSite.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSite.ps1
@@ -134,6 +134,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSolution.ps1 b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSolution.ps1
index 920dee4f9106..0c0d3cfb70ec 100644
--- a/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSolution.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Get-AzMigrateSolution.ps1
@@ -139,6 +139,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateHCIReplicationInfrastructure.ps1 b/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateHCIReplicationInfrastructure.ps1
new file mode 100644
index 000000000000..a1e03d869a65
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateHCIReplicationInfrastructure.ps1
@@ -0,0 +1,210 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Initializes the infrastructure for the migrate project.
+.Description
+The Initialize-AzMigrateHCIReplicationInfrastructure cmdlet initializes the infrastructure for the migrate project in AzStackHCI scenario.
+.Example
+Initialize-AzMigrateHCIReplicationInfrastructure -ProjectName "testproj" -ResourceGroupName "test-rg" -SourceApplianceName "testsrcapp" -TargetApplianceName "testtgtapp" -PassThru:$true
+.Example
+$cacheStorageAccountId = "/subscriptions/xxx-xxx-xxxx/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/testSa"
+
+Initialize-AzMigrateHCIReplicationInfrastructure -ProjectName "testproj" -ResourceGroupName "test-rg" -CacheStorageAccountId $cacheStorageAccountId -SourceApplianceName "testsrcapp" -TargetApplianceName "testtgtapp" -PassThru:$true
+
+.Outputs
+System.Boolean
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/initialize-azmigratehcireplicationinfrastructure
+#>
+function Initialize-AzMigrateHCIReplicationInfrastructure {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='AzStackHCI', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Resource Group of the Azure Migrate Project in the current subscription.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the name of the Azure Migrate project to be used for server migration.
+ ${ProjectName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the source appliance name for the AzStackHCI scenario.
+ ${SourceApplianceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the target appliance name for the AzStackHCI scenario.
+ ${TargetApplianceName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Storage Account ARM Id to be used for private endpoint scenario.
+ ${CacheStorageAccountId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ AzStackHCI = 'Az.Migrate.custom\Initialize-AzMigrateHCIReplicationInfrastructure';
+ }
+ if (('AzStackHCI') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateReplicationInfrastructure.ps1 b/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateReplicationInfrastructure.ps1
index 7031a582b514..89c822d7f8f5 100644
--- a/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateReplicationInfrastructure.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/Initialize-AzMigrateReplicationInfrastructure.ps1
@@ -155,6 +155,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateDiskMapping.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateDiskMapping.ps1
index a0266dab0bbd..7f2124ac4ec0 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateDiskMapping.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateDiskMapping.ps1
@@ -88,6 +88,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCIDiskMappingObject.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCIDiskMappingObject.ps1
new file mode 100644
index 000000000000..7235b3511cc2
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCIDiskMappingObject.ps1
@@ -0,0 +1,144 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Creates a new disk mapping
+.Description
+The New-AzMigrateHCIDiskMappingObject cmdlet creates a mapping of the source disk attached to the server to be migrated
+.Example
+New-AzMigrateHCIDiskMappingObject -DiskID a -IsOSDisk true -IsDynamic true -Size 1 -Format VHDX
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratehcidiskmappingobject
+#>
+function New-AzMigrateHCIDiskMappingObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the disk ID of the disk attached to the discovered server to be migrated.
+ ${DiskID},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter({ "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies whether the disk contains the Operating System for the source server to be migrated.
+ ${IsOSDisk},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter({ "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies whether the disk is dynamic.
+ ${IsDynamic},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int64]
+ # Specifies the disk size in GB.
+ ${Size},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter({ "VHD", "VHDX" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the disk format.
+ ${Format}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.Migrate.custom\New-AzMigrateHCIDiskMappingObject';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCINicMappingObject.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCINicMappingObject.ps1
new file mode 100644
index 000000000000..bda8c1625b52
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCINicMappingObject.ps1
@@ -0,0 +1,137 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Creates an object to update NIC properties of a replicating server.
+.Description
+The New-AzMigrateHCINicMappingObject cmdlet creates a mapping of the source NIC attached to the server to be migrated.
+This object is provided as an input to the Set-AzMigrateServerReplication cmdlet to update the NIC and its properties for a replicating server.
+.Example
+New-AzMigrateHCINicMappingObject -NicID a -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external"
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratehcinicmappingobject
+#>
+function New-AzMigrateHCINicMappingObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the ID of the NIC to be updated.
+ ${NicID},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the logical network ARM ID that the VMs will use.
+ ${TargetVirtualSwitchId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the test logical network ARM ID that the VMs will use.
+ ${TargetTestVirtualSwitchId},
+
+ [Parameter()]
+ [ArgumentCompleter({ "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies whether the this Nic should be created at target.
+ ${CreateAtTarget}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.Migrate.custom\New-AzMigrateHCINicMappingObject';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCIServerReplication.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCIServerReplication.ps1
new file mode 100644
index 000000000000..5056dc9631dd
--- /dev/null
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateHCIServerReplication.ps1
@@ -0,0 +1,254 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Starts replication for the specified server.
+.Description
+The New-AzMigrateHCIServerReplication cmdlet starts the replication for a particular discovered server in the Azure Migrate project.
+.Example
+New-AzMigrateHCIServerReplication -MachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/testsrc7972site/machines/005-005-005" -OSDiskID "Microsoft:0EC082D5-6827-457A-BAE2-F986E1B94851\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -TargetStoragePathId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/storagecontainers/testStorageContainer1" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external" -TargetResourceGroupId "/subscriptions//xxx-xxx-xxx/resourceGroups/target-rg"-TargetVMName "targetVM"
+.Example
+[AzStackHCIDiskInput[]]$DisksToInclude = @()
+$OSDisk = New-AzMigrateHCIDiskMappingObject -DiskID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -IsOSDisk true -IsDynamic true -Size 42 -Format VHD
+$DataDisk = New-AzMigrateHCIDiskMappingObject -DiskID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\C92FAB89-DA8B-47E9-92F3-364642ECDF39\0\0\L" -IsOSDisk false -IsDynamic true -Size 5 -Format VHD
+$DisksToInclude += $OSDisk
+$DisksToInclude += $DataDisk
+
+[AzStackHCINicInput[]]$NicsToInclude = @()
+$Nic = New-AzMigrateHCINicMappingObject -NicID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\99CDFD2E-D60C-4218-AC2E-E7C2D8253EB9" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external"
+$NicsToInclude += $Nic
+
+New-AzMigrateHCIServerReplication -MachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/testsrc7972site/machines/005-005-005" -TargetStoragePathId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/storagecontainers/testStorageContainer1" -TargetResourceGroupId "/subscriptions//xxx-xxx-xxx/resourceGroups/target-rg"-TargetVMName "targetVM" -DiskToInclude $DisksToInclude -NicToInclude $NicsToInclude
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratehciserverreplication
+#>
+function New-AzMigrateHCIServerReplication {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
+[CmdletBinding(DefaultParameterSetName='ByIdDefaultUser', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the machine ARM ID of the discovered server to be migrated.
+ ${MachineId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the storage path ARM ID where the VMs will be stored.
+ ${TargetStoragePathId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the target Resource Group Id where the migrated VM resources will reside.
+ ${TargetResourceGroupId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the name of the VM to be created.
+ ${TargetVMName},
+
+ [Parameter(ParameterSetName='ByIdDefaultUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the logical network ARM ID that the VMs will use.
+ ${TargetVirtualSwitchId},
+
+ [Parameter(ParameterSetName='ByIdDefaultUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the Operating System disk for the source server to be migrated.
+ ${OSDiskID},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int32]
+ # Specifies the number of CPU cores.
+ ${TargetVMCPUCore},
+
+ [Parameter(ParameterSetName='ByIdDefaultUser')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the test logical network ARM ID that the VMs will use.
+ ${TargetTestVirtualSwitchId},
+
+ [Parameter()]
+ [ArgumentCompleter({ "true" , "false" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies if RAM is dynamic or not.
+ ${IsDynamicMemoryEnabled},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.Int64]
+ # Specifies the target RAM size in MB.
+ ${TargetVMRam},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='ByIdPowerUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCIDiskInput[]]
+ # Specifies the disks on the source server to be included for replication.
+ ${DiskToInclude},
+
+ [Parameter(ParameterSetName='ByIdPowerUser', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.AzStackHCINicInput[]]
+ # Specifies the NICs on the source server to be included for replication.
+ ${NicToInclude},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ ByIdDefaultUser = 'Az.Migrate.custom\New-AzMigrateHCIServerReplication';
+ ByIdPowerUser = 'Az.Migrate.custom\New-AzMigrateHCIServerReplication';
+ }
+ if (('ByIdDefaultUser', 'ByIdPowerUser') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateNicMapping.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateNicMapping.ps1
index adbc433b2860..c9734bc13110 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateNicMapping.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateNicMapping.ps1
@@ -106,6 +106,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateProject.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateProject.ps1
index d1b23bffaa3d..faf2bab6aab2 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateProject.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateProject.ps1
@@ -108,6 +108,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationPolicy.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationPolicy.ps1
index 9e95b0b31558..1e1ad1fc0d60 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationPolicy.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationPolicy.ps1
@@ -169,6 +169,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationProtectionContainerMapping.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationProtectionContainerMapping.ps1
index ee60398162ad..8d74084ff132 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationProtectionContainerMapping.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateReplicationProtectionContainerMapping.ps1
@@ -197,6 +197,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateServerReplication.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateServerReplication.ps1
index 6e8d74288825..0ea3ed4c4c0c 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateServerReplication.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateServerReplication.ps1
@@ -318,6 +318,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateTestNicMapping.ps1 b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateTestNicMapping.ps1
index ae59b715201d..4f4a48237444 100644
--- a/src/Migrate/Migrate.Autorest/exports/New-AzMigrateTestNicMapping.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/New-AzMigrateTestNicMapping.ps1
@@ -75,6 +75,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
diff --git a/src/Migrate/Migrate.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Migrate/Migrate.Autorest/exports/ProxyCmdletDefinitions.ps1
index 869ada34eed0..6a38e7a68885 100644
--- a/src/Migrate/Migrate.Autorest/exports/ProxyCmdletDefinitions.ps1
+++ b/src/Migrate/Migrate.Autorest/exports/ProxyCmdletDefinitions.ps1
@@ -14,6 +14,257 @@
# is regenerated.
# ----------------------------------------------------------------------------------
+<#
+.Synopsis
+Gets the details of the fabric.
+.Description
+Gets the details of the fabric.
+.Example
+Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg" -Name "testsrcappreplicationfabric"
+.Example
+$InputObject = Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg" -Name "testsrcappreplicationfabric"
+
+Get-AzMigrateHCIReplicationFabric -InputObject $InputObject
+
+$InputObject | Get-AzMigrateHCIReplicationFabric
+.Example
+Get-AzMigrateHCIReplicationFabric -ResourceGroupName "test-rg"
+.Example
+Get-AzMigrateHCIReplicationFabric
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IFabricModel
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [AccountName ]: Run as account ARM name.
+ [AlertSettingName ]: The name of the email notification configuration.
+ [ClusterName ]: Cluster ARM name.
+ [DatabaseInstanceName ]: Unique name of a database instance in Azure migration hub.
+ [DatabaseName ]: Unique name of a database in Azure migration hub.
+ [DeploymentId ]: Deployment Id.
+ [EmailConfigurationName ]: The email configuration name.
+ [EventName ]: Unique name of an event within a migrate project.
+ [FabricAgentName ]: The fabric agent (Dra) name.
+ [FabricName ]: Fabric name.
+ [HostName ]: Host ARM name.
+ [Id ]: Resource identity path
+ [IntentObjectName ]: Replication protection intent name.
+ [JobName ]: Job ARM name.
+ [Location ]: The name of the Azure region.
+ [LogicalNetworkName ]: Logical network name.
+ [MachineName ]: Machine ARM name.
+ [MappingName ]: Protection Container mapping name.
+ [MigrateProjectName ]: Name of the Azure Migrate project.
+ [MigrationItemName ]: Migration item name.
+ [MigrationRecoveryPointName ]: The migration recovery point name.
+ [NetworkMappingName ]: Network mapping name.
+ [NetworkName ]: Primary network name.
+ [OperationId ]: The ID of an ongoing async operation.
+ [OperationStatusName ]: Operation status ARM name.
+ [PolicyName ]: Replication policy name.
+ [ProtectableItemName ]: Protectable item name.
+ [ProtectedItemName ]: The protected item name.
+ [ProtectionContainerName ]: Protection container name.
+ [ProviderName ]: Recovery services provider name.
+ [RecoveryPlanName ]: Name of the recovery plan.
+ [RecoveryPointName ]: The recovery point name.
+ [ReplicatedProtectedItemName ]: Replication protected item name.
+ [ReplicationExtensionName ]: The replication extension name.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [ResourceName ]: The name of the recovery services vault.
+ [SiteName ]: Site name.
+ [SolutionName ]: Unique name of a migration solution within a migrate project.
+ [StorageClassificationMappingName ]: Storage classification mapping name.
+ [StorageClassificationName ]: Storage classification name.
+ [SubscriptionId ]: The ID of the target subscription.
+ [VaultName ]: The vault name.
+ [VaultSettingName ]: Vault setting name.
+ [VcenterName ]: VCenter ARM name.
+ [VirtualMachineName ]: Virtual Machine name.
+.Link
+https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcireplicationfabric
+#>
+function Get-AzMigrateHCIReplicationFabric {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IFabricModel])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('FabricName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The fabric name.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription Id in which migrate project was created.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Query')]
+ [System.String]
+ # Continuation token from the previous call.
+ ${ContinuationToken},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_Get';
+ GetViaIdentity = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_GetViaIdentity';
+ List = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_List';
+ List1 = 'Az.Migrate.private\Get-AzMigrateHCIReplicationFabric_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
<#
.Synopsis
Method to get a migrate project.
@@ -133,6 +384,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -310,6 +565,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -481,6 +740,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -665,6 +928,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -844,6 +1111,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -1019,6 +1290,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -1191,6 +1466,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -1355,6 +1634,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -1524,6 +1807,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -1723,6 +2010,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -1950,6 +2241,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -2125,6 +2420,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -2303,6 +2602,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -2364,14 +2667,18 @@ Get-AzMigrateDiscoveredServer -Name idclab-a360-fareast-corp-micros-86617dcf-eff
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName BugBashAVSVMware -ProjectName BugBashAVSVMware -DisplayName Contoso | Format-Table DisplayName,Name,Type
.Example
Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName BugBashAVSVMware -ProjectName BugBashAVSVMware -ApplianceName BBVMwareAVS -DisplayName Contoso | Format-Table DisplayName,Name,Type
+.Example
+Get-AzMigrateDiscoveredServer -SubscriptionId xxx-xxx-xxx -ResourceGroupName "test-rg" -ProjectName "testproj" -SourceMachineType "HyperV" | Format-Table DisplayName,Name,Type
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IHyperVMachine
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine
.Link
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratediscoveredserver
#>
function Get-AzMigrateDiscoveredServer {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IVMwareMachine], [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202001.IHyperVMachine])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -2390,9 +2697,17 @@ param(
[Parameter(ParameterSetName='ListInSite')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the VMware machine display name.
+ # Specifies the source machine display name.
${DisplayName},
+ [Parameter()]
+ [ArgumentCompleter({ "VMware", "HyperV" })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
+ [System.String]
+ # Specifies the source machine type.
+ # Currently, only HyperV and VMware are supported.
+ ${SourceMachineType},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
@@ -2404,7 +2719,7 @@ param(
[Parameter(ParameterSetName='Get', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
[System.String]
- # Specifies the VMware machine name.
+ # Specifies the source machine name.
# This is an internal Name.
# For users, use display name.
${Name},
@@ -2454,6 +2769,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -2502,70 +2821,82 @@ end {
.Synopsis
Retrieves the status of an Azure Migrate job.
.Description
-The Get-AzMigrateJob cmdlet retrives the status of an Azure Migrate job.
+The Get-AzMigrateHCIJob cmdlet retrives the status of an Azure Migrate job.
.Example
-Get-AzMigrateJob -JobID "/Subscriptions/xxx-xxx-xxx/resourceGroups/azmigratepwshtestasr13072020/providers/Microsoft.RecoveryServices/vaults/AzMigrateTestProjectPWSH02aarsvault/replicationJobs/997e2a92-5afe-49c7-a81a-89660aec9b7b"
+Get-AzMigrateHCIJob -ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a"
.Example
-Get-AzMigrateJob -ResourceGroupName 'azmigratepwshtestasr13072020' -ProjectName 'AzMigrateTestProjectPWSH'
+Get-AzMigrateHCIJob -ResourceGroupName "test-rg" -ProjectName "testproj" -Name "0203aa1b-1dff-4653-89a9-b90a76d1601a"
.Example
-Get-AzMigrateJob -ResourceGroupName 'azmigratepwshtestasr13072020' -ProjectName 'AzMigrateTestProjectPWSH' -JobName 7ae1ee7c-442c-499d-8b0e-81d52a42b71e
+$InputObject = Get-AzMigrateHCIJob -ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/testproj1234replicationvault/jobs/0203aa1b-1dff-4653-89a9-b90a76d1601a"
+
+Get-AzMigrateHCIJob -InputObject $InputObject
+$InputObject | Get-AzMigrateHCIJob
+.Example
+Get-AzMigrateHCIJob -ResourceGroupID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg" -ProjectID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/providers/Microsoft.Migrate/MigrateProjects/testproj"
+.Example
+Get-AzMigrateHCIJob -ResourceGroupName "test-rg" -ProjectName "testproj"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.IMigrateIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IJob
+Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Specifies the job object of the replicating server.
- [Location ]: Resource Location
- [ActivityId ]: The activity id.
- [AllowedAction ]: The Allowed action the job.
- [CustomDetailAffectedObjectDetail ]: The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details.
- [(Any) ]: This indicates any property can be added to this object.
- [CustomDetailInstanceType ]: Gets the type of job details (see JobDetailsTypes enum for possible values).
- [EndTime ]: The end time.
- [Error ]: The errors.
- [CreationTime ]: The creation time of job error.
- [ErrorLevel ]: Error level of error.
- [ProviderErrorDetailErrorCode ]: The Error code.
- [ProviderErrorDetailErrorId ]: The Provider error Id.
- [ProviderErrorDetailErrorMessage ]: The Error message.
- [ProviderErrorDetailPossibleCaus ]: The possible causes for the error.
- [ProviderErrorDetailRecommendedAction ]: The recommended action to resolve the error.
- [ServiceErrorDetailActivityId ]: Activity Id.
- [ServiceErrorDetailCode ]: Error code.
- [ServiceErrorDetailMessage ]: Error message.
- [ServiceErrorDetailPossibleCaus ]: Possible causes of error.
- [ServiceErrorDetailRecommendedAction ]: Recommended action to resolve error.
- [TaskId ]: The Id of the task.
- [FriendlyName ]: The DisplayName.
- [ScenarioName ]: The ScenarioName.
- [StartTime ]: The start time.
- [State ]: The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other.
- [StateDescription ]: The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped.
- [TargetInstanceType ]: The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class.
- [TargetObjectId ]: The affected Object Id.
- [TargetObjectName ]: The name of the affected object.
- [Task ]: The tasks.
- [AllowedAction ]: The state/actions applicable on this task.
- [CustomDetailInstanceType ]: The type of task details.
- [EndTime ]: The end time.
- [Error ]: The task error details.
- [FriendlyName ]: The name.
- [GroupTaskCustomDetailChildTask ]: The child tasks.
- [GroupTaskCustomDetailInstanceType ]: The type of task details.
- [Name ]: The unique Task name.
- [StartTime ]: The start time.
- [State ]: The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other.
- [StateDescription ]: The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped.
- [TaskId ]: The Id.
- [TaskType ]: The type of task. Details in CustomDetails property depend on this type.
+INPUTOBJECT : Specifies the job object of the replicating server.
+ [AccountName ]: Run as account ARM name.
+ [AlertSettingName ]: The name of the email notification configuration.
+ [ClusterName ]: Cluster ARM name.
+ [DatabaseInstanceName ]: Unique name of a database instance in Azure migration hub.
+ [DatabaseName ]: Unique name of a database in Azure migration hub.
+ [DeploymentId ]: Deployment Id.
+ [EmailConfigurationName ]: The email configuration name.
+ [EventName ]: Unique name of an event within a migrate project.
+ [FabricAgentName ]: The fabric agent (Dra) name.
+ [FabricName ]: Fabric name.
+ [HostName ]: Host ARM name.
+ [Id ]: Resource identity path
+ [IntentObjectName ]: Replication protection intent name.
+ [JobName ]: Job ARM name.
+ [Location ]: The name of the Azure region.
+ [LogicalNetworkName ]: Logical network name.
+ [MachineName ]: Machine ARM name.
+ [MappingName ]: Protection Container mapping name.
+ [MigrateProjectName ]: Name of the Azure Migrate project.
+ [MigrationItemName ]: Migration item name.
+ [MigrationRecoveryPointName ]: The migration recovery point name.
+ [NetworkMappingName ]: Network mapping name.
+ [NetworkName