Created
October 15, 2021 15:00
-
-
Save likamrat/cb136ed450768bceb393f7d955709f9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SourceResourceGroupName = "Heaven" | |
$DestinationResourceGroupName = "Hell" | |
$DestinationSubscriptionId = "Hell Subscription Id" | |
$NumMachines = 2 | |
$AzureArcMachine = Get-AzResource -ResourceGroupName $SourceResourceGroupName -ResourceType Microsoft.HybridCompute/machines | Select-Object -First $NumMachines | |
ForEach-Object { | |
$AzureArcMachine | ForEach-Object { | |
Move-AzResource -DestinationSubscriptionId $DestinationSubscriptionId -DestinationResourceGroupName $DestinationResourceGroupName -ResourceId $AzureArcMachine.ResourceId -Confirm:$false -Force | |
} | |
Start-Sleep -Seconds 300 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment