Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Last active July 7, 2018 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PixelRobots/910f4d3738ff64964e56eaa87bfb12f0 to your computer and use it in GitHub Desktop.
Save PixelRobots/910f4d3738ff64964e56eaa87bfb12f0 to your computer and use it in GitHub Desktop.
New-NetFirewallRule -DisplayName "Allow ICMPv4-In" -Protocol ICMPv4
$vnet1Name = 'Pixel1'
$vnet1RG = 'Pixel1'
$vnet2Name = 'Pixel2'
$vnet2RG = 'Pixel2'
$vnet1 = Get-AzureRmVirtualNetwork -Name $vnet1Name -ResourceGroupName $vnet1RG
$vnet2 = Get-AzureRmVirtualNetwork -Name $vnet2Name -ResourceGroupName $vnet2RG
Add-AzureRmVirtualNetworkPeering -Name $vnet1Name'-to-'$vnet2Name -VirtualNetwork $vnet1 -RemoteVirtualNetworkId $vnet2.Id
Add-AzureRmVirtualNetworkPeering -Name $vnet2Name'-to-'$vnet1Name -VirtualNetwork $vnet2 -RemoteVirtualNetworkId $vnet1.Id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment