{"id":3641,"date":"2016-07-01T16:42:17","date_gmt":"2016-07-01T07:42:17","guid":{"rendered":"http:\/\/www.syuheiuda.com\/?p=3641"},"modified":"2016-07-01T16:42:17","modified_gmt":"2016-07-01T07:42:17","slug":"azure-powershell-%e3%81%a7%e5%a4%9a%e6%95%b0%e3%81%ae%e3%83%aa%e3%82%bd%e3%83%bc%e3%82%b9%e3%82%92%e4%b8%a6%e5%88%97%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.syuheiuda.com\/?p=3641","title":{"rendered":"Azure PowerShell \u3067\u591a\u6570\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4e26\u5217\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<p>US \u306e Azure Support Team \u306e\u30d6\u30ed\u30b0\u304b\u3089\u4fbf\u5229\u306a TIPS \u3092\u629c\u7c8b\u3002<\/p>\n<h2>\u60f3\u5b9a\u3055\u308c\u308b\u30b7\u30ca\u30ea\u30aa<\/h2>\n<p>\u4f8b\u3048\u3070\u3001NIC \u3084 Public IP \u3092\u5927\u91cf\u306b\u4f5c\u6210\u3059\u308b\u969b\u30011 \u500b\u305a\u3064\u540c\u671f\u7684\u306b\u4f5c\u6210\u3059\u308b\u3068\u3001\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002<br \/>\n(\u4f8b\u3048\u3070\u30011 \u3064\u306e\u4f5c\u6210\u306b 30 \u79d2\u304b\u304b\u308b\u5834\u5408\u3001\u5358\u7d14\u8a08\u7b97\u3067 30 \u500b\u4f5c\u308b\u306b\u306f\u00a015 \u5206\u304b\u304b\u308a\u307e\u3059)<\/p>\n<p>\u3053\u308c\u3092\u975e\u540c\u671f\u3067\u4e00\u62ec\u4f5c\u6210\u3059\u308c\u3070\u3001\u4f55\u500b\u4f5c\u308d\u3046\u304c 1 \u500b\u4f5c\u6210\u3059\u308b\u306e\u3068\u5927\u5dee\u306a\u3044\u6642\u9593\u3067\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>VPN Gateway \u3068\u304b\u3001Application Gateway \u306e\u3088\u3046\u306b 1 \u500b\u5f53\u305f\u308a\u6570\u5341\u5206\u304b\u304b\u308b\u3088\u3046\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u306f\u975e\u5e38\u306b\u4f7f\u3048\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<h2>\u5177\u4f53\u7684\u306a\u65b9\u6cd5<\/h2>\n<p>\u4ee5\u4e0b\u306b ARM \u3067 Public IP \u3092\u6307\u5b9a\u3057\u305f\u500b\u6570\u4f5c\u6210\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong><a href=\"https:\/\/gallery.technet.microsoft.com\/Execute-a-synchronous-8113cf56\" target=\"_blank\">TechNet Gallery Code Sample<\/a><\/strong><\/p>\n<p>\u203b \u6587\u5b57\u30b3\u30fc\u30c9\u306e\u305b\u3044\u304b\u3001\u6587\u5b57\u5316\u3051\u3057\u307e\u3059\u304c\u300112 \u884c\u76ee\u306e\u672b\u5c3e\u3092 (&#8220;System.Diagnostics&#8221;) \u306b\u3059\u308c\u3070\u30a8\u30e9\u30fc\u306a\u304f\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u9577\u304f\u3066\u4f55\u3092\u3084\u3063\u3066\u3044\u308b\u304b\u304c\u4e00\u76ee\u3067\u306f\u5206\u304b\u308a\u306b\u304f\u3044\u306e\u3067\u3001\u6700\u5c0f\u9650\u306b\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30dd\u30a4\u30f3\u30c8\u306f 11 \u884c\u76ee\u3067\u4e26\u5217\u5b9f\u884c\u3059\u308b\u51e6\u7406\u3092 $sb (ScriptBlock?) \u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u6240\u3068\u300114 \u884c\u76ee\u306e [PowerShell]::Create() \u3042\u305f\u308a\u3067\u3059\u304b\u306d\u3002<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\"># \u5909\u6570\u5b9a\u7fa9\r\n&#x5B;int]$count = &quot;&lt;\u4f5c\u6210\u6570&gt;&quot;\r\n&#x5B;string]$namePrefix = &quot;&lt;\u30ea\u30bd\u30fc\u30b9\u540d\u306e\u63a5\u982d\u8f9e&gt;&quot;\r\n&#x5B;string]$rgName = &quot;&lt;\u30ea\u30bd\u30fc\u30b9 \u30b0\u30eb\u30fc\u30d7\u540d&gt;&quot;\r\n&#x5B;string]$location = &quot;&lt;\u30ea\u30fc\u30b8\u30e7\u30f3\u540d&gt;&quot;\r\n\r\n# \u30b8\u30e7\u30d6\u306e\u4f5c\u6210\u3068\u958b\u59cb\u3092 $count \u56de\u30eb\u30fc\u30d7\u5b9f\u884c\r\nfor($i=1;$i -le $count;$i++){\r\n $sb = {\r\n Param($namePrefix,$i,$rgName,$location)\r\n $dontcare = New-AzureRmPublicIpAddress -Name &quot;$($namePrefix)$($i)&quot; -ResourceGroupName $rgName -Location $location -AllocationMethod Dynamic\r\n }\r\n\r\nNew-Variable -Name &quot;create$($namePrefix)$($i)&quot; -Value (&#x5B;PowerShell]::Create())\r\n (Get-Variable -Name &quot;create$($namePrefix)$($i)&quot; -ValueOnly).AddScript($sb).AddArgument($namePrefix).AddArgument($i).AddArgument($rgName).AddArgument($location)\r\n New-Variable -Name &quot;jobCreate$($namePrefix)$($i)&quot; -Value ((Get-Variable -Name &quot;create$($namePrefix)$($i)&quot; -ValueOnly).BeginInvoke())\r\n}<\/pre>\n<p>\u3067\u3001\u5143\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u3092\u6e2c\u308b\u305f\u3081\u306b\u30b9\u30c8\u30c3\u30d7\u30a6\u30a9\u30c3\u30c1\u3067\u6642\u9593\u3092\u6e2c\u3063\u3066\u3044\u305f\u308a\u3001\u30b8\u30e7\u30d6\u304c\u5b8c\u4e86\u3057\u305f\u304b\u3092\u3072\u305f\u3059\u3089\u30eb\u30fc\u30d7\u3067\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u308b\u306e\u3067\u9577\u304f\u306a\u3063\u3066\u307e\u3059\u3002\u4f7f\u3044\u3053\u306a\u305b\u308b\u3068\u4fbf\u5229\u306a\u306e\u3067\u3001\u5fc5\u8981\u306b\u306a\u3063\u305f\u3068\u304d\u306f\u7a4d\u6975\u7684\u306b\u30b5\u30f3\u30d7\u30eb\u3092\u30d1\u30af\u3063\u3066\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u30cd\u30bf\u5143<\/h2>\n<ul>\n<li><span style=\"letter-spacing: 0.05em; line-height: 1.6875;\">Microsoft Azure: How to execute a synchronous Azure PowerShell cmdlet multiple times at once, using a single PowerShell session<br \/>\n<\/span><a href=\"https:\/\/blogs.msdn.microsoft.com\/mast\/2016\/06\/29\/microsoft-azure-how-to-execute-a-synchronous-azure-powershell-cmdlet-multiple-times-at-once-using-a-single-powershell-session\/\"><span style=\"letter-spacing: 0.05em; line-height: 1.6875;\">https:\/\/blogs.msdn.microsoft.com\/mast\/2016\/06\/29\/microsoft-azure-how-to-execute-a-synchronous-azure-powershell-cmdlet-multiple-times-at-once-using-a-single-powershell-session\/<\/span><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>US \u306e Azure Support Team \u306e\u30d6\u30ed\u30b0\u304b\u3089\u4fbf\u5229\u306a TIPS \u3092&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.syuheiuda.com\/?p=3641\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_locale":"","_original_post":""},"categories":[39,31],"tags":[],"views":4642,"_links":{"self":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3641"}],"collection":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3641"}],"version-history":[{"count":7,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3641\/revisions"}],"predecessor-version":[{"id":3649,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3641\/revisions\/3649"}],"wp:attachment":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}