An Azure resource group was initially deployed from an Azure Resource Manager (ARM) template. Resources have since been added and modified manually through Azure portal.
You need to create a new template based on the current state of the resource group.
Which PowerShell cmdlet should you use?
You should use the Export-AzureRmResourceGroup cmdlet. This cmdlet captures a specified resource group and saves it as a template to a JSON file. This gives you a way to create a template based on the current resources in a resource group. You also have the option of exporting a running resource group as a template from Azure portal.
You should not use the Save-AzureRmResourceGroupDeploymentTemplate cmdlet. This saves a resource group deployment, not the current resource group, to a file. You must specify both the deployment name and resource group name.
You should not use the Save-AzureRmDeploymentTemplate cmdlet. This saves an existing deployment template to a new template file.
You should not use the New-AzureRmResourceGroupDeployment cmdlet. This cmdlet is used to apply a template to an existing resource group, not create a new template file.