{"id":74441,"date":"2015-11-06T11:59:00","date_gmt":"2015-11-06T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2015\/11\/06\/powertip-find-if-variable-is-array\/"},"modified":"2022-05-05T03:35:35","modified_gmt":"2022-05-05T10:35:35","slug":"powertip-find-if-variable-is-array","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-find-if-variable-is-array\/","title":{"rendered":"PowerTip: Find if Variable Is Array"},"content":{"rendered":"<p style=\"margin-left:30px\">\n<p style=\"margin-left:30px\">\n  <b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Use Windows PowerShell to find if a variable is an array.<\/span>\n<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>\u00a0How can I use Windows PowerShell to find if a variable contains an array?<\/p>\n<p style=\"margin-left:30px\">\n  <img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>\u00a0Use the\u00a0<b>\u2013is<\/b>\u00a0operator, and test to see if it is a type of\u00a0<b>[array]<\/b>, for example:\n<\/p>\n<p style=\"margin-left:120px\">\n  $a = 1,2,4,5,6,7\n<\/p>\n<p style=\"margin-left:120px\">\n  $a -is [array]\n<\/p>\n<p style=\"margin-left:30px\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2018\/09\/dr_scripto-102x150.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2018\/09\/dr_scripto-102x150.gif\" border=\"0\" alt=\" \" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use Windows PowerShell to find if a variable is an array. \u00a0How can I use Windows PowerShell to find if a variable contains an array? \u00a0Use the\u00a0\u2013is\u00a0operator, and test to see if it is a type of\u00a0[array], for example: $a = 1,2,4,5,6,7 $a -is [array]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[442,51,356,3,45],"class_list":["post-74441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-arrays","tag-getting-started","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use Windows PowerShell to find if a variable is an array. \u00a0How can I use Windows PowerShell to find if a variable contains an array? \u00a0Use the\u00a0\u2013is\u00a0operator, and test to see if it is a type of\u00a0[array], for example: $a = 1,2,4,5,6,7 $a -is [array]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/74441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=74441"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/74441\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=74441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=74441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=74441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}