Skip to content

Instantly share code, notes, and snippets.

@tjgruber
Last active March 15, 2020 11:24
Show Gist options
  • Save tjgruber/d65acb63fbd6a8254b9b02597da1c1e3 to your computer and use it in GitHub Desktop.
Save tjgruber/d65acb63fbd6a8254b9b02597da1c1e3 to your computer and use it in GitHub Desktop.
param(
$Name = 'WEB1',
$Location = 'westeurope',
$ResourceGroup = 'WebServers'
)
New-AzResourceGroup -Name $ResourceGroup -Location $Location
$params = @{
Name = $Name
Location = $Location
ResourceGroup = $ResourceGroup
VirtualNetworkName = "$ResourceGroup-VNET"
SubnetName = "$ResourceGroup-Subnet"
SecurityGroupName = "$Name-NSG"
PublicIpAddressName = 'myPublicIp'
OpenPorts = 80
}
New-AzVm @params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment