New-AzureRmRoleDefinitation -Role $customRole
JSON file looks like this:
{
"Name": "Network Resource Viewer",
"IsCustom": true,
"Description": "Allows reading Azure network resources.",
"Actions": [ "Microsoft.Network/*/read" ],
"NotActions": [ ],
"AssignableScopes": [ "/subscriptions/048.." ]
}