Skip to content

Instantly share code, notes, and snippets.

@orlea
Last active February 27, 2020 08:48
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 orlea/aa8d7a2432e73ab18d0bdbc87f861fd3 to your computer and use it in GitHub Desktop.
Save orlea/aa8d7a2432e73ab18d0bdbc87f861fd3 to your computer and use it in GitHub Desktop.
Azure AutomationでAzureのVPN Gatewayをリセットするやつ。credentialとvariableはautomationアカウントで設定
$credential_name = Get-AutomationVariable -Name "credential_name"
$credential = Get-AutomationPSCredential -Name $credential_name
$resource_group = Get-AutomationVariable -Name "resource_group"
$gw_name = Get-AutomationVariable -Name "gw_name"
Connect-AzAccount -Credential $credential
$gw = Get-AzVirtualNetworkGateway -ResourceGroupName $resource_group -Name $gw_name
Reset-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -AsJob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment