Skip to content

Instantly share code, notes, and snippets.

@likamrat
Created October 15, 2021 15:00
Show Gist options
  • Save likamrat/cb136ed450768bceb393f7d955709f9c to your computer and use it in GitHub Desktop.
Save likamrat/cb136ed450768bceb393f7d955709f9c to your computer and use it in GitHub Desktop.
$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