New-ResourceGroup
Azure: Creates a resource group
param(
[Parameter(Mandatory = $true)]
[string]$Name,
[Parameter(Mandatory = $true)]
[string]$Location
)
try {
Import-Module Az.Resources -ErrorAction Stop
$rg = New-AzResourceGroup -Name $Name -Location $Location -ErrorAction Stop
Write-Output $rg
} catch {
Write-Error $_
exit 1
}The name of the resource group.
The Azure region where the resource group will be created.