From 62be6e54856903e16ad3842665ae8bb91ad36666 Mon Sep 17 00:00:00 2001 From: "v-yuzhichen@microsoft.com" Date: Fri, 8 Apr 2022 17:58:28 +0800 Subject: [PATCH 1/2] Fix Az.ResoureMover Syntax Errors --- src/ResourceMover/help/Add-AzResourceMoverMoveResource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md b/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md index ea1ca692351c..912eb916753a 100644 --- a/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md +++ b/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md @@ -108,7 +108,7 @@ Add a resource to the Move Collection that has existing target resource. ### Example 3: Update target resource settings after the Move Resource has been added. ```powershell -Update-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj +Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj DependsOn : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Network/networkInterfaces/psdemov From ada49ddb91b077c53adbfc07b69482fd81fa9e2e Mon Sep 17 00:00:00 2001 From: Ziyue Zheng Date: Thu, 21 Apr 2022 16:46:49 +0800 Subject: [PATCH 2/2] Fix Az.ResoureMover Syntax Errors --- .../help/Add-AzResourceMoverMoveResource.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md b/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md index 912eb916753a..0d560b8dc539 100644 --- a/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md +++ b/src/ResourceMover/help/Add-AzResourceMoverMoveResource.md @@ -26,8 +26,14 @@ Creates or updates a Move Resource in the move collection. ### Example 1: Add a resource to the Move Collection. ```powershell +$targetResourceSettingsObj = New-Object Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.VirtualMachineResourceSettings +$targetResourceSettingsObj.ResourceType = "Microsoft.Compute/virtualMachines" +$targetResourceSettingsObj.TargetResourceName = "PSDemoVM" + Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $targetResourceSettingsObj +``` +```output DependsOn : {} DependsOnOverride : {} ErrorsPropertiesCode : @@ -57,11 +63,6 @@ SystemDataLastModifiedBy : SystemDataLastModifiedByType : TargetId : Type : - -$targetResourceSettingsObj = New-Object Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.VirtualMachineResourceSettings -$targetResourceSettingsObj.ResourceType = "Microsoft.Compute/virtualMachines" -$targetResourceSettingsObj.TargetResourceName = "PSDemoVM" - ``` Add a resource to the Move Collection. @@ -101,16 +102,20 @@ SystemDataLastModifiedBy : SystemDataLastModifiedByType : TargetId : Type : - ``` Add a resource to the Move Collection that has existing target resource. ### Example 3: Update target resource settings after the Move Resource has been added. ```powershell -Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj +$moveResourceObj = Get-AzResourceMoverMoveResource -MoveCollectionName "PS-centralus-westcentralus-demoRMS1" -ResourceGroupName "RG-MoveCollection-demoRMS" -Name "PSDemoVM" +$TargetResourceSettingObj = $moveResourceObj.ResourceSetting +$TargetResourceSettingObj.TargetResourceName = "PSDemoVM-target" +Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj +``` +```output DependsOn : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Network/networkInterfaces/psdemov m111, /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM} DependsOnOverride : {} @@ -141,11 +146,6 @@ SystemDataLastModifiedBy : SystemDataLastModifiedByType : TargetId : Type : - -$moveResourceObj = Get-AzResourceMoverMoveResource -MoveCollectionName "PS-centralus-westcentralus-demoRMS1" -ResourceGroupName "RG-MoveCollection-demoRMS" -Name "PSDemoVM" -$TargetResourceSettingObj = $moveResourceObj.ResourceSetting -$TargetResourceSettingObj.TargetResourceName="PSDemoVM-target" - ``` Update target resource settings after the Move Resource has been added.