This script is confusing me. For restoring the dedicated sql pool to a new subscription. The commands appear to create a brand new synapse workspace with a new sql pool (with the same name as your original pool), and then takes a restore point of this new database. Is that correct? Shouldn't we be taking a restore point of our existing sql pool in our existing synapse workspace?
EDIT: I did test this and as is that is exactly what it did. It created a new database with the same name and this empty database is what was restored to my target synapse workspace. You need to use your own source synapse workspace in that variable.
Be careful with this code at the end if you're using your existing synapse workspace.
Set-AzContext -SubscriptionId $SourceSubscriptionId
# remove the source resources
Remove-AzSynapseWorkspace -ResourceGroupName $SourceResourceGroupName -Name $SourceWorkspaceName -Force
In my opinion, this script should be cleaned up and reposted to prevent confusion from developers in the future.