I've been working with Azure runbooks and I ocassionally actually dump the default scripts that are generated from the portal and run them. This last time, I spent a little time cleaning it up to keep around.
I'll probably share the completed thing later, but I wanted to post this correction right away because it's pretty confusing.
There's an internal private function in the generated Deploy.ps1 which looks like this, but really should just be a one-liner like this:
"microsoft.compute", "microsoft.network" | Register-AzureRmResourceProvider -ProviderNamespace { $_ }