Last active
December 11, 2017 10:30
-
-
Save takekazuomi/371c2e4b5bc40c2ade73e33a23083d29 to your computer and use it in GitHub Desktop.
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
$j = Get-AzureRmResourceGroup | ? { | |
$_.ResourceGroupName -like "hogehoge*" | |
} | % { | |
Start-Job { | |
param ($c, $n) Remove-AzureRmResourceGroup -AzureRmContext $c -ResourceGroupName $n -Verbose -Confirm:$false -Force | |
} -ArgumentList (Get-AzureRmContext), $_.ResourceGroupName | |
} | |
$j | Receive-Job -AutoRemoveJob -Wait -WriteJobInResults | |
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
$j=Get-AzureRmResourceGroup | ? {$_.ResourceGroupName -like "hogehoge*"} |%{ Start-Job {param ($c, $n) Remove-AzureRmResourceGroup -AzureRmContext $c -ResourceGroupName $n -Verbose -Confirm:$false -Force} -ArgumentList (Get-AzureRmContext), $_.ResourceGroupName}; $j | Receive-Job -AutoRemoveJob -Wait -WriteJobInResults |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment