Last active
February 27, 2020 08:48
-
-
Save orlea/aa8d7a2432e73ab18d0bdbc87f861fd3 to your computer and use it in GitHub Desktop.
Azure AutomationでAzureのVPN Gatewayをリセットするやつ。credentialとvariableはautomationアカウントで設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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