{"id":86335,"date":"2019-09-18T13:00:12","date_gmt":"2019-09-18T21:00:12","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/scripting\/?p=86335"},"modified":"2019-09-19T03:58:15","modified_gmt":"2019-09-19T11:58:15","slug":"powertip-identify-which-platform-powershell-is-running-on","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-identify-which-platform-powershell-is-running-on\/","title":{"rendered":"PowerTip: Identify which Platform PowerShell is running on"},"content":{"rendered":"<p><strong>Summary<\/strong>: Using $PSVersionTable to identify if you are on Windows or Unix<\/p>\n<p><img decoding=\"async\" width=\"34\" height=\"34\" class=\"wp-image-86336\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/09\/a-picture-containing-scissors-description-automat-2.jpeg\" alt=\"A picture containing scissors\n\nDescription automatically generated\" \/><\/p>\n<p>Hey, Doctor Scripto! I&#8217;m working on my PowerShell scripts and I need to be able to identify if I&#8217;m working on Windows or Linux. How can I do this easily?<\/p>\n<p><img decoding=\"async\" width=\"34\" height=\"34\" class=\"wp-image-86337\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/09\/word-image-2.jpeg\" \/><\/p>\n<p>No problem at all and glad to help. Just examine the $PSVersionTable property called Platform. It will contain one either &#8216;Unix&#8217;,&#8217;Win32NT&#8217; on PowerShell Core. In the case of Windows PowerShell it will not exist.<\/p>\n<p><strong>$PSVersionTable.Platform<\/strong><\/p>\n<p><img decoding=\"async\" width=\"96\" height=\"145\" class=\"wp-image-86338\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/09\/word-image-11.png\" \/><\/p>\n<p>PowerShell, Doctor Scripto, PowerTip, Sean Kearney<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Using $PSVersionTable to identify if you are on Windows or Unix Hey, Doctor Scripto! I&#8217;m working on my PowerShell scripts and I need to be able to identify if I&#8217;m working on Windows or Linux. How can I do this easily? No problem at all and glad to help. Just examine the $PSVersionTable property [&hellip;]<\/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":[1739,1738,639],"tags":[1740,377,356,154],"class_list":["post-86335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-doctor-scripto","category-powershell","category-powertip","tag-doctor-scripto","tag-powershell","tag-powertip","tag-sean-kearney"],"acf":[],"blog_post_summary":"<p>Summary: Using $PSVersionTable to identify if you are on Windows or Unix Hey, Doctor Scripto! I&#8217;m working on my PowerShell scripts and I need to be able to identify if I&#8217;m working on Windows or Linux. How can I do this easily? No problem at all and glad to help. Just examine the $PSVersionTable property [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/86335","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=86335"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/86335\/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=86335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=86335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=86335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}