{"id":10364,"date":"2023-01-08T00:33:31","date_gmt":"2023-01-07T15:33:31","guid":{"rendered":"https:\/\/extan.jp\/?p=10364"},"modified":"2023-01-08T00:38:12","modified_gmt":"2023-01-07T15:38:12","slug":"powershell%e3%81%ae%e3%83%ab%e3%83%bc%e3%83%97%e5%87%a6%e7%90%86%e6%96%b9%e6%b3%95%e3%81%be%e3%81%a8%e3%82%81%ef%bc%81for-while-do-while%e3%82%84foreach-foreach-object%e3%82%82%ef%bc%81","status":"publish","type":"post","link":"https:\/\/extan.jp\/?p=10364","title":{"rendered":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01"},"content":{"rendered":"<p>PowerShell\u3067\u30eb\u30fc\u30d7\uff08\u7e70\u308a\u8fd4\u3057\uff09\u51e6\u7406\u3092\u3057\u305f\u3044\u3068\u304d\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3051\u3069\u3001\u305d\u3093\u306a\u4e2d\u3067\u60a9\u3080\u3053\u3068\u306f\u3001<\/p>\n<div class=\"kininarukoto1\">\u30fbPowerShell\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3057\u305f\u3044\u304c\u65b9\u6cd5\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044<br \/>\n\u30fbPowerShell\u3067\u3069\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u4f7f\u3063\u305f\u3089\u3088\u3044\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044<\/div>\n<p>\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u4eca\u56de\u306f\u305d\u3093\u306a\u304a\u60a9\u307f\u3092\u89e3\u6c7a\u3059\u308b<\/p>\n<div class=\"rdinfo\">\u30fbPowerShell\u3067For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3092\u4f7f\u3044\u30eb\u30fc\u30d7\uff08\u7e70\u308a\u8fd4\u3057\uff09\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5<\/div>\n<p>\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u307e\u3059\uff01<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u3082\u304f\u3058<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/extan.jp\/?p=10364\/#PowerShell%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95\" >PowerShell\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/extan.jp\/?p=10364\/#PowerShell%E3%81%AEFor%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\" >PowerShell\u306eFor\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/extan.jp\/?p=10364\/#PowerShell%E3%81%AEWhile%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\" >PowerShell\u306eWhile\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/extan.jp\/?p=10364\/#PowerShell%E3%81%AEDo-While%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\" >PowerShell\u306eDo-While\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/extan.jp\/?p=10364\/#PowerShell%E3%81%AEForEach%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\" >PowerShell\u306eForEach\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/extan.jp\/?p=10364\/#PowerShell%E3%81%AEForEach-Object%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\" >PowerShell\u306eForEach-Object\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/extan.jp\/?p=10364\/#%E3%81%95%E3%81%84%E3%81%94%E3%81%AB\" >\u3055\u3044\u3054\u306b<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"PowerShell%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95\"><\/span>PowerShell\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>PowerShell\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>PowerShell\u3067\u306f\u3001\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u884c\u3046\u65b9\u6cd5\u3068\u3057\u3066\u4ee5\u4e0b\u306e3\u3064\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"info\"><code>For: \u30b3\u30fc\u30c9\u306e\u30d6\u30ed\u30c3\u30af\u3092\u7279\u5b9a\u306e\u56de\u6570\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\nForEach: \u30a2\u30a4\u30c6\u30e0\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3 (\u914d\u5217\u3084\u30ea\u30b9\u30c8\u306a\u3069) \u3092\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3057\u3001\u540c\u6642\u306b\u30a2\u30a4\u30c6\u30e0\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\nWhile: \u7279\u5b9a\u306e\u6761\u4ef6\u304c\u771f\u3067\u3042\u308b\u9650\u308a\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u7d9a\u3051\u307e\u3059\u3002<\/code><\/div>\n<p>\u305d\u308c\u305e\u308c\u7279\u6027\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5177\u4f53\u7684\u306b\u3069\u306e\u3088\u3046\u306b\u3057\u3066\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u884c\u3046\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>{\u8aac\u660e}<\/p>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell%E3%81%AEFor%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\"><\/span>PowerShell\u306eFor\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell\u306eFor\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u3057\u307e\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<p>\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>for (\u521d\u671f\u5024\u8a2d\u5b9a\u5f0f; \u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f; \u30eb\u30fc\u30d7\u66f4\u65b0\u5f0f){<br \/>\n\u51e6\u7406<br \/>\n}<\/code><\/div>\n<p>For\u6587\u306f\u521d\u671f\u5024\u8a2d\u5b9a\u5f0f\u3067\u521d\u671f\u5024\u3092\u8a2d\u5b9a\u3057\u3001\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f\u304c\u771f(true)\u306e\u9593\u3001\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u304a\u3053\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"info\">\n<p><code>\u521d\u671f\u5024\u8a2d\u5b9a\u5f0f: \u3053\u3053\u3067\u3001\u30eb\u30fc\u30d7\u5909\u6570\u306e\u521d\u671f\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u30eb\u30fc\u30d7\u306e\u958b\u59cb\u6642\u306b 1 \u56de\u3060\u3051\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/code><\/p>\n<p>\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f: \u3053\u308c\u306f\u3001\u30eb\u30fc\u30d7\u306e\u5404\u53cd\u5fa9\u306e\u524d\u306b\u8a55\u4fa1\u3055\u308c\u308b\u30d6\u30fc\u30eb\u5f0f\u3067\u3059\u3002\u6761\u4ef6\u304c \u306e\u5834\u5408$true\u3001\u30eb\u30fc\u30d7\u306f\u5b9f\u884c\u3092\u7d9a\u3051\u307e\u3059\u3002\u6761\u4ef6\u304cFalse \u306e\u5834\u5408\u3001\u30eb\u30fc\u30d7\u306f\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>\u30eb\u30fc\u30d7\u66f4\u65b0\u5f0f: \u3053\u308c\u306f\u3001\u30eb\u30fc\u30d7\u306e\u5404\u7e70\u308a\u8fd4\u3057\u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002\u901a\u5e38\u3001\u30eb\u30fc\u30d7\u5909\u6570\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n<h4>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre style=\"padding: 0;\"><code class=\"language-powershell line-numbers\">for ($i = 1; $i -le 10; $i++) {\n  Write-Output $i\n}<\/code><\/pre>\n<p>1 \u304b\u3089 10 \u307e\u3067\u30ab\u30a6\u30f3\u30c8\u3057\u3001\u7d50\u679c\u3092\u51fa\u529b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u521d\u671f\u5024\u8a2d\u5b9a\u5f0f\u3067\u5909\u6570$i\u306e\u521d\u671f\u5024\u3092 1 \u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f\u3067$i \uff1e 10\u306e\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u30eb\u30fc\u30d7\u306f\u5909\u6570$i\u304c 10 \u4ee5\u4e0b\u3067\u3042\u308b\u9650\u308a\u7d99\u7d9a\u3057\u307e\u3059\u3002<br \/>\n\u30eb\u30fc\u30d7\u66f4\u65b0\u5f0f\u3067\u30eb\u30fc\u30d7\u3054\u3068\u306b$i\u306e\u5024\u30921 \u305a\u3064\u5897\u3084\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<\/code><\/div>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell%E3%81%AEWhile%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\"><\/span>PowerShell\u306eWhile\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell\u306eWhile\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u3057\u307e\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<p>\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>while (\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f){<br \/>\n\u51e6\u7406<br \/>\n}<\/code><\/div>\n<p>While\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f\u304c\u771f(true)\u306e\u9593\u3001\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u304a\u3053\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"info\"><code>\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f: \u3053\u308c\u306f\u3001\u30eb\u30fc\u30d7\u306e\u5404\u53cd\u5fa9\u306e\u524d\u306b\u8a55\u4fa1\u3055\u308c\u308b\u30d6\u30fc\u30eb\u5f0f\u3067\u3059\u3002\u6761\u4ef6\u304c \u306e\u5834\u5408$true\u3001\u30eb\u30fc\u30d7\u306f\u5b9f\u884c\u3092\u7d9a\u3051\u307e\u3059\u3002\u6761\u4ef6\u304cFalse \u306e\u5834\u5408\u3001\u30eb\u30fc\u30d7\u306f\u7d42\u4e86\u3057\u307e\u3059\u3002<\/code><\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u306f\u3058\u307e\u308a--><\/p>\n<div class=\"balloon5\">\n<div class=\"faceicon\">\n<img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/11\/taka_kao.gif\" alt=\"\u30bf\u30ab\u30d2\u30ed\" width=\"110\" height=\"110\" \/>\n<div class=\"faceiconfont\">\u30bf\u30ab\u30d2\u30ed<\/div>\n<\/div>\n<div class=\"chatting\">\n<div class=\"says\">While\u6587\u306f\u30eb\u30fc\u30d7\u306e\u672c\u4f53\u306b\u6761\u4ef6\u3092\u66f4\u65b0\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u5927\u4e8b\u3067\u3059\u3002\u8a2d\u5b9a\u3057\u306a\u3044\u5834\u5408\u30eb\u30fc\u30d7\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/div>\n<\/div>\n<\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u7d42\u308f\u308a--><\/p>\n<h4>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre style=\"padding: 0;\"><code class=\"language-powershell line-numbers\">$i = 1\nwhile($i -le 10) {\n  Write-Output $i\n  $i++\n}<\/code><\/pre>\n<p>1 \u304b\u3089 10 \u307e\u3067\u30ab\u30a6\u30f3\u30c8\u3057\u3001\u7d50\u679c\u3092\u51fa\u529b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u5909\u6570$i\u3092 1 \u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f\u3067$i \uff1e 10\u306e\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u30eb\u30fc\u30d7\u306f\u5909\u6570$i\u304c 10 \u4ee5\u4e0b\u3067\u3042\u308b\u9650\u308a\u7d99\u7d9a\u3057\u307e\u3059\u3002<br \/>\n\u5909\u6570\u306e\u5024\u3092\u51fa\u529b\u3057\u305f\u5f8c\u3001$i\u306e\u5024\u30921 \u305a\u3064\u5897\u3084\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<\/code><\/div>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell%E3%81%AEDo-While%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\"><\/span>PowerShell\u306eDo-While\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell\u306eDo-While\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u3057\u307e\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<p>\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>do {\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u30ea\u30b9\u30c8} while (\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f)<\/code><\/div>\n<p>Do-While\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f\u304c\u771f(true)\u306e\u9593\u3001Do\u5074\u3067\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u304a\u3053\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"info\"><code>\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u30ea\u30b9\u30c8\uff1a\u30eb\u30fc\u30d7\u304c\u5165\u529b\u307e\u305f\u306f\u7e70\u308a\u8fd4\u3055\u308c\u308b\u305f\u3073\u306b\u5b9f\u884c\u3055\u308c\u308b 1 \u3064\u4ee5\u4e0a\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u542b\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f: \u3053\u308c\u306f\u3001\u30eb\u30fc\u30d7\u306e\u5404\u53cd\u5fa9\u306e\u524d\u306b\u8a55\u4fa1\u3055\u308c\u308b\u30d6\u30fc\u30eb\u5f0f\u3067\u3059\u3002\u6761\u4ef6\u304c \u306e\u5834\u5408$true\u3001\u30eb\u30fc\u30d7\u306f\u5b9f\u884c\u3092\u7d9a\u3051\u307e\u3059\u3002\u6761\u4ef6\u304cFalse \u306e\u5834\u5408\u3001\u30eb\u30fc\u30d7\u306f\u7d42\u4e86\u3057\u307e\u3059\u3002<\/code><\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u306f\u3058\u307e\u308a--><\/p>\n<div class=\"balloon5\">\n<div class=\"faceicon\">\n<img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/11\/taka_kao.gif\" alt=\"\u30bf\u30ab\u30d2\u30ed\" width=\"110\" height=\"110\" \/>\n<div class=\"faceiconfont\">\u30bf\u30ab\u30d2\u30ed<\/div>\n<\/div>\n<div class=\"chatting\">\n<div class=\"says\">While\u6587\u306f\u30eb\u30fc\u30d7\u306e\u672c\u4f53\u306b\u6761\u4ef6\u3092\u66f4\u65b0\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u5927\u4e8b\u3067\u3059\u3002\u8a2d\u5b9a\u3057\u306a\u3044\u5834\u5408\u30eb\u30fc\u30d7\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/div>\n<\/div>\n<\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u7d42\u308f\u308a--><\/p>\n<h4>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre style=\"padding: 0;\"><code class=\"language-powershell line-numbers\">$i = 1\ndo {\n  Write-Output $i\n  $i++\n}\nwhile($i -le 10)<\/code><\/pre>\n<p>1 \u304b\u3089 10 \u307e\u3067\u30ab\u30a6\u30f3\u30c8\u3057\u3001\u7d50\u679c\u3092\u51fa\u529b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u5909\u6570$i\u3092 1 \u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\nDo\u306e\u90e8\u5206\u3067\u5909\u6570\u306e\u5024\u3092\u51fa\u529b\u3057\u305f\u5f8c\u3001$i\u306e\u5024\u30921 \u305a\u3064\u5897\u3084\u3057\u307e\u3059\u3002<br \/>\n\u30eb\u30fc\u30d7\u6761\u4ef6\u5f0f\u3067$i \uff1e 10\u306e\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u30eb\u30fc\u30d7\u306f\u5909\u6570$i\u304c 10 \u4ee5\u4e0b\u3067\u3042\u308b\u9650\u308a\u7d99\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<\/code><\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u306f\u3058\u307e\u308a--><\/p>\n<div class=\"balloon5\">\n<div class=\"faceicon\">\n<img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/11\/taka_kao.gif\" alt=\"\u30bf\u30ab\u30d2\u30ed\" width=\"110\" height=\"110\" \/>\n<div class=\"faceiconfont\">\u30bf\u30ab\u30d2\u30ed<\/div>\n<\/div>\n<div class=\"chatting\">\n<div class=\"says\">While\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u51e6\u7406\u306e\u90e8\u5206\u304cDo\u306b\u79fb\u3063\u305f\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n<\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u7d42\u308f\u308a--><\/p>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell%E3%81%AEForEach%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\"><\/span>PowerShell\u306eForEach\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell\u306eForEach\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u3057\u307e\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<p>\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>foreach (\u30a2\u30a4\u30c6\u30e0 in \u30b3\u30ec\u30af\u30b7\u30e7\u30f3) {<br \/>\n\u51e6\u7406<br \/>\n}<\/code><\/div>\n<p>ForEach\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u30a2\u30a4\u30c6\u30e0\u304c\u5b58\u5728\u3059\u308b\u9593\u3001\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u304a\u3053\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"info\">\n<p><code>\u30a2\u30a4\u30c6\u30e0: \u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5185\u306e\u30a2\u30a4\u30c6\u30e0\u5909\u6570\u3067\u3059\u3002\u4efb\u610f\u306e\u540d\u524d\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u901a\u5e38\u306f$item\u307e\u305f\u306f$_.\u3068\u306a\u308a\u307e\u3059\u3002<\/code><\/p>\n<p>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3: \u30eb\u30fc\u30d7\u51e6\u7406\u3055\u305b\u305f\u3044\u30a2\u30a4\u30c6\u30e0\u30ea\u30b9\u30c8\u3067\u3059\u3002\u30ea\u30b9\u30c8\u306f\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306a\u3069\u3044\u308d\u3044\u308d\u306a\u30bf\u30a4\u30d7\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u306f\u3058\u307e\u308a--><\/p>\n<div class=\"balloon5\">\n<div class=\"faceicon\">\n<img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/11\/taka_kao.gif\" alt=\"\u30bf\u30ab\u30d2\u30ed\" width=\"110\" height=\"110\" \/>\n<div class=\"faceiconfont\">\u30bf\u30ab\u30d2\u30ed<\/div>\n<\/div>\n<div class=\"chatting\">\n<div class=\"says\">While\u6587\u306f\u30eb\u30fc\u30d7\u306e\u672c\u4f53\u306b\u6761\u4ef6\u3092\u66f4\u65b0\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u5927\u4e8b\u3067\u3059\u3002\u8a2d\u5b9a\u3057\u306a\u3044\u5834\u5408\u30eb\u30fc\u30d7\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/div>\n<\/div>\n<\/div>\n<p><!--\u5439\u304d\u51fa\u3057\u7d42\u308f\u308a--><\/p>\n<h4>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre style=\"padding: 0;\"><code class=\"language-powershell line-numbers\">$colors = &quot;\u9752&quot;, &quot;\u8d64&quot;, &quot;\u9ec4\u8272&quot;\nforeach ($color in $colors) {\n  Write-Output $color\n}<\/code><\/pre>\n<p>\u914d\u5217\u306b&#8221;\u9752&#8221;, &#8220;\u8d64&#8221;, &#8220;\u9ec4\u8272&#8221;\u3092\u8a2d\u5b9a\u3057\u3001\u914d\u5217\u306e\u8981\u7d20\u3092\u53d6\u5f97\u3057\u3001\u305d\u306e\u8981\u7d20\u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>\u9752<br \/>\n\u8d64<br \/>\n\u9ec4\u8272<\/code><\/div>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell%E3%81%AEForEach-Object%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%82%92%E3%81%99%E3%82%8B\"><\/span>PowerShell\u306eForEach-Object\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell\u306eForEach-Object\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>ForEach-Object\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u30eb\u30fc\u30d7\u51e6\u7406\u3057\u3001\u5404\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3057\u3066\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u30b3\u30de\u30f3\u30c9\u30ec\u30c3\u30c8\u3067\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<p>\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>Get-Command | ForEach-Object {<br \/>\n\u51e6\u7406<br \/>\n}<\/code><\/div>\n<p>PowerShell\u306eForEach-Object\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306fForEach\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u914d\u5217\u3084\u30ea\u30b9\u30c8\u3060\u3051\u3067\u306a\u304f\u3001\u3042\u3089\u3086\u308b\u30bf\u30a4\u30d7\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u64cd\u4f5c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre style=\"padding: 0;\"><code class=\"language-powershell line-numbers\">Get-Process | ForEach-Object -Process {\n  if ($_.Id -gt 20000) {\n    Write-Output &quot;$($_.ProcessName) ($($_.Id))&quot;\n  }\n}<\/code><\/pre>\n<p>\u4f7f\u7528\u53ef\u80fd\u306a\u3059\u3079\u3066\u306e\u30b3\u30de\u30f3\u30c9\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3057\u3001\u5404\u30b3\u30de\u30f3\u30c9\u306e\u30b3\u30fc\u30c9 \u30d6\u30ed\u30c3\u30af\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5185\u306e\u5404\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3057\u3066Process\u30d6\u30ed\u30c3\u30af\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u30d7\u30ed\u30bb\u30b9 ID \u304c20000 \u3088\u308a\u5927\u304d\u3044\u30d7\u30ed\u30bb\u30b9\u306e\u307f\u3092\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3067\u3059\u3002<\/p>\n<div class=\"info\"><code>EXCEL (20924)<br \/>\nEXCEL (21660)<br \/>\nEXCEL (21988)<br \/>\nEXCEL (23836)<br \/>\nEXCEL (24304)<br \/>\nEXCEL (24432)<br \/>\nEXCEL (25428)<br \/>\nEXCEL (25520)<br \/>\nEXCEL (25972)<br \/>\nEXCEL (26192)<br \/>\nEXCEL (26604)<br \/>\nEXCEL (26780)<br \/>\n\u30fb\u30fb\u30fb<\/code><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E3%81%95%E3%81%84%E3%81%94%E3%81%AB\"><\/span>\u3055\u3044\u3054\u306b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001<\/p>\n<div class=\"endinfo\">\u30fbPowerShell\u3067For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3092\u4f7f\u3044\u30eb\u30fc\u30d7\uff08\u7e70\u308a\u8fd4\u3057\uff09\u51e6\u7406\u3092\u3059\u308b\u65b9\u6cd5<\/div>\n<p>\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u4ed6\u306b\u3082\u4fbf\u5229\u306a\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3088\u308d\u3057\u3051\u308c\u3070\u3054\u53c2\u7167\u9802\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell\u3067\u30eb\u30fc\u30d7\uff08\u7e70\u308a\u8fd4\u3057\uff09\u51e6\u7406\u3092\u3057\u305f\u3044\u3068\u304d\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002 \u3051\u3069\u3001\u305d\u3093\u306a\u4e2d\u3067\u60a9\u3080\u3053\u3068\u306f\u3001 \u30fbPowerShell\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3057\u305f\u3044\u304c\u65b9\u6cd5\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044 \u30fbPowerShell\u3067\u3069\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u4f7f\u3063\u305f\u3089\u3088&#8230;<\/p>\n","protected":false},"author":1,"featured_media":10244,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[204],"tags":[203],"class_list":{"0":"post-10364","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-powershell","8":"tag-powershell","9":"article cf"},"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"\u30bf\u30ab\u30d2\u30ed@extan\"\/>\n\t<meta name=\"keywords\" content=\"powershell\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/extan.jp\/?p=10364\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u30a8\u30af\u77ed\uff5cExtan.jp\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/extan.jp\/?p=10364\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-01-07T15:33:31+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-01-07T15:38:12+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#article\",\"name\":\"PowerShell\\u306e\\u30eb\\u30fc\\u30d7\\u51e6\\u7406\\u65b9\\u6cd5\\u307e\\u3068\\u3081\\uff01For\\\/While\\\/Do-While\\u3084ForEach\\\/ForEach-Object\\u3082\\uff01 | \\u30a8\\u30af\\u77ed\\uff5cExtan.jp\",\"headline\":\"PowerShell\\u306e\\u30eb\\u30fc\\u30d7\\u51e6\\u7406\\u65b9\\u6cd5\\u307e\\u3068\\u3081\\uff01For\\\/While\\\/Do-While\\u3084ForEach\\\/ForEach-Object\\u3082\\uff01\",\"author\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/extan.jp\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/powershell.png\",\"width\":857,\"height\":607,\"caption\":\"powershell\"},\"datePublished\":\"2023-01-08T00:33:31+09:00\",\"dateModified\":\"2023-01-08T00:38:12+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#webpage\"},\"articleSection\":\"PowerShell, PowerShell\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp#listItem\",\"position\":1,\"name\":\"\\u30db\\u30fc\\u30e0\",\"item\":\"https:\\\/\\\/extan.jp\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?cat=47#listItem\",\"name\":\"Microsoft 365\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?cat=47#listItem\",\"position\":2,\"name\":\"Microsoft 365\",\"item\":\"https:\\\/\\\/extan.jp\\\/?cat=47\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?cat=204#listItem\",\"name\":\"PowerShell\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp#listItem\",\"name\":\"\\u30db\\u30fc\\u30e0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?cat=204#listItem\",\"position\":3,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/extan.jp\\\/?cat=204\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#listItem\",\"name\":\"PowerShell\\u306e\\u30eb\\u30fc\\u30d7\\u51e6\\u7406\\u65b9\\u6cd5\\u307e\\u3068\\u3081\\uff01For\\\/While\\\/Do-While\\u3084ForEach\\\/ForEach-Object\\u3082\\uff01\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?cat=47#listItem\",\"name\":\"Microsoft 365\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#listItem\",\"position\":4,\"name\":\"PowerShell\\u306e\\u30eb\\u30fc\\u30d7\\u51e6\\u7406\\u65b9\\u6cd5\\u307e\\u3068\\u3081\\uff01For\\\/While\\\/Do-While\\u3084ForEach\\\/ForEach-Object\\u3082\\uff01\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?cat=204#listItem\",\"name\":\"PowerShell\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/extan.jp\\\/#organization\",\"name\":\"\\u30a8\\u30af\\u77ed\\uff5cExtan.jp\",\"description\":\"\\u50cd\\u304f\\u4eba\\u306e\\u81ea\\u7531\\u6642\\u9593\\u3092\\u3064\\u304f\\u308b\",\"url\":\"https:\\\/\\\/extan.jp\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?author=1#author\",\"url\":\"https:\\\/\\\/extan.jp\\\/?author=1\",\"name\":\"\\u30bf\\u30ab\\u30d2\\u30ed@extan\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a74fef504a714c468411d23f2d1fd451892ffebbba0d84f70d4ce0d489aefb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"\\u30bf\\u30ab\\u30d2\\u30ed@extan\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#webpage\",\"url\":\"https:\\\/\\\/extan.jp\\\/?p=10364\",\"name\":\"PowerShell\\u306e\\u30eb\\u30fc\\u30d7\\u51e6\\u7406\\u65b9\\u6cd5\\u307e\\u3068\\u3081\\uff01For\\\/While\\\/Do-While\\u3084ForEach\\\/ForEach-Object\\u3082\\uff01 | \\u30a8\\u30af\\u77ed\\uff5cExtan.jp\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?author=1#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/extan.jp\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/powershell.png\",\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364\\\/#mainImage\",\"width\":857,\"height\":607,\"caption\":\"powershell\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/?p=10364#mainImage\"},\"datePublished\":\"2023-01-08T00:33:31+09:00\",\"dateModified\":\"2023-01-08T00:38:12+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/extan.jp\\\/#website\",\"url\":\"https:\\\/\\\/extan.jp\\\/\",\"name\":\"\\u30a8\\u30af\\u77ed\\uff5cExtan.jp\",\"description\":\"\\u50cd\\u304f\\u4eba\\u306e\\u81ea\\u7531\\u6642\\u9593\\u3092\\u3064\\u304f\\u308b\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/extan.jp\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp","description":"","canonical_url":"https:\/\/extan.jp\/?p=10364","robots":"max-image-preview:large","keywords":"powershell","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/extan.jp\/?p=10364#article","name":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp","headline":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01","author":{"@id":"https:\/\/extan.jp\/?author=1#author"},"publisher":{"@id":"https:\/\/extan.jp\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/extan.jp\/wp-content\/uploads\/2022\/12\/powershell.png","width":857,"height":607,"caption":"powershell"},"datePublished":"2023-01-08T00:33:31+09:00","dateModified":"2023-01-08T00:38:12+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/extan.jp\/?p=10364#webpage"},"isPartOf":{"@id":"https:\/\/extan.jp\/?p=10364#webpage"},"articleSection":"PowerShell, PowerShell"},{"@type":"BreadcrumbList","@id":"https:\/\/extan.jp\/?p=10364#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/extan.jp#listItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/extan.jp","nextItem":{"@type":"ListItem","@id":"https:\/\/extan.jp\/?cat=47#listItem","name":"Microsoft 365"}},{"@type":"ListItem","@id":"https:\/\/extan.jp\/?cat=47#listItem","position":2,"name":"Microsoft 365","item":"https:\/\/extan.jp\/?cat=47","nextItem":{"@type":"ListItem","@id":"https:\/\/extan.jp\/?cat=204#listItem","name":"PowerShell"},"previousItem":{"@type":"ListItem","@id":"https:\/\/extan.jp#listItem","name":"\u30db\u30fc\u30e0"}},{"@type":"ListItem","@id":"https:\/\/extan.jp\/?cat=204#listItem","position":3,"name":"PowerShell","item":"https:\/\/extan.jp\/?cat=204","nextItem":{"@type":"ListItem","@id":"https:\/\/extan.jp\/?p=10364#listItem","name":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01"},"previousItem":{"@type":"ListItem","@id":"https:\/\/extan.jp\/?cat=47#listItem","name":"Microsoft 365"}},{"@type":"ListItem","@id":"https:\/\/extan.jp\/?p=10364#listItem","position":4,"name":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01","previousItem":{"@type":"ListItem","@id":"https:\/\/extan.jp\/?cat=204#listItem","name":"PowerShell"}}]},{"@type":"Organization","@id":"https:\/\/extan.jp\/#organization","name":"\u30a8\u30af\u77ed\uff5cExtan.jp","description":"\u50cd\u304f\u4eba\u306e\u81ea\u7531\u6642\u9593\u3092\u3064\u304f\u308b","url":"https:\/\/extan.jp\/"},{"@type":"Person","@id":"https:\/\/extan.jp\/?author=1#author","url":"https:\/\/extan.jp\/?author=1","name":"\u30bf\u30ab\u30d2\u30ed@extan","image":{"@type":"ImageObject","@id":"https:\/\/extan.jp\/?p=10364#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/24a74fef504a714c468411d23f2d1fd451892ffebbba0d84f70d4ce0d489aefb?s=96&d=mm&r=g","width":96,"height":96,"caption":"\u30bf\u30ab\u30d2\u30ed@extan"}},{"@type":"WebPage","@id":"https:\/\/extan.jp\/?p=10364#webpage","url":"https:\/\/extan.jp\/?p=10364","name":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp","inLanguage":"ja","isPartOf":{"@id":"https:\/\/extan.jp\/#website"},"breadcrumb":{"@id":"https:\/\/extan.jp\/?p=10364#breadcrumblist"},"author":{"@id":"https:\/\/extan.jp\/?author=1#author"},"creator":{"@id":"https:\/\/extan.jp\/?author=1#author"},"image":{"@type":"ImageObject","url":"https:\/\/extan.jp\/wp-content\/uploads\/2022\/12\/powershell.png","@id":"https:\/\/extan.jp\/?p=10364\/#mainImage","width":857,"height":607,"caption":"powershell"},"primaryImageOfPage":{"@id":"https:\/\/extan.jp\/?p=10364#mainImage"},"datePublished":"2023-01-08T00:33:31+09:00","dateModified":"2023-01-08T00:38:12+09:00"},{"@type":"WebSite","@id":"https:\/\/extan.jp\/#website","url":"https:\/\/extan.jp\/","name":"\u30a8\u30af\u77ed\uff5cExtan.jp","description":"\u50cd\u304f\u4eba\u306e\u81ea\u7531\u6642\u9593\u3092\u3064\u304f\u308b","inLanguage":"ja","publisher":{"@id":"https:\/\/extan.jp\/#organization"}}]},"og:locale":"ja_JP","og:site_name":"\u30a8\u30af\u77ed\uff5cExtan.jp","og:type":"article","og:title":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp","og:url":"https:\/\/extan.jp\/?p=10364","article:published_time":"2023-01-07T15:33:31+00:00","article:modified_time":"2023-01-07T15:38:12+00:00","twitter:card":"summary","twitter:title":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01 | \u30a8\u30af\u77ed\uff5cExtan.jp"},"aioseo_meta_data":{"post_id":"10364","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2026-06-24 15:27:58","updated":"2026-06-24 15:27:58","primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/extan.jp\" title=\"\u30db\u30fc\u30e0\">\u30db\u30fc\u30e0<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/extan.jp\/?cat=47\" title=\"Microsoft 365\">Microsoft 365<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/extan.jp\/?cat=204\" title=\"PowerShell\">PowerShell<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"\u30db\u30fc\u30e0","link":"https:\/\/extan.jp"},{"label":"Microsoft 365","link":"https:\/\/extan.jp\/?cat=47"},{"label":"PowerShell","link":"https:\/\/extan.jp\/?cat=204"},{"label":"PowerShell\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u65b9\u6cd5\u307e\u3068\u3081\uff01For\/While\/Do-While\u3084ForEach\/ForEach-Object\u3082\uff01","link":"https:\/\/extan.jp\/?p=10364"}],"_links":{"self":[{"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/posts\/10364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/extan.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10364"}],"version-history":[{"count":5,"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/posts\/10364\/revisions"}],"predecessor-version":[{"id":10369,"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/posts\/10364\/revisions\/10369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/extan.jp\/index.php?rest_route=\/wp\/v2\/media\/10244"}],"wp:attachment":[{"href":"https:\/\/extan.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/extan.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/extan.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}