{"id":85967,"date":"2015-11-06T06:17:19","date_gmt":"2015-11-06T14:17:19","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/scripting\/?p=85967"},"modified":"2019-06-06T06:20:54","modified_gmt":"2019-06-06T14:20:54","slug":"powertip-find-if-variable-is-array-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-find-if-variable-is-array-2\/","title":{"rendered":"PowerTip: Find if Variable Is Array"},"content":{"rendered":"<\/p>\n<p style=\"margin-left:30px;\">\n<p style=\"margin-left:30px;\"><b style=\"font-size:12px;\">Summary<\/b><span style=\"font-size:12px;\">: Use Windows PowerShell to find if a variable is an array.<\/span><\/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\" \/>&nbsp;How can I use Windows PowerShell to find if a variable contains an array?<\/p>\n<p style=\"margin-left:30px;\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Use the&nbsp;<b>&ndash;is<\/b>&nbsp;operator, and test to see if it is a type of&nbsp;<b>[array]<\/b>, for example:<\/p>\n<p style=\"margin-left:120px;\">$a = 1,2,4,5,6,7<\/p>\n<p style=\"margin-left:120px;\">$a -is [array]<\/p>\n<p style=\"margin-left:30px;\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/7610.Dr.ScriptoForTips.jpg\" original-url=\"http:\/\/blogs.technet.com\/cfs-file.ashx\/__key\/communityserver-blogs-components-weblogfiles\/00-00-00-76-18\/7610.Dr.ScriptoForTips.jpg\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/7610.Dr.ScriptoForTips.jpg\" original-url=\"http:\/\/blogs.technet.comhttps:\/\/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. &nbsp;How can I use Windows PowerShell to find if a variable contains an array? &nbsp;Use the&nbsp;&ndash;is&nbsp;operator, and test to see if it is a type of&nbsp;[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":[553,600,3,45],"class_list":["post-85967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-ise","tag-powershell-5-0","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use Windows PowerShell to find if a variable is an array. &nbsp;How can I use Windows PowerShell to find if a variable contains an array? &nbsp;Use the&nbsp;&ndash;is&nbsp;operator, and test to see if it is a type of&nbsp;[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\/85967","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=85967"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/85967\/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=85967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=85967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=85967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}