{"id":14690,"date":"2018-03-29T06:00:08","date_gmt":"2018-03-29T13:00:08","guid":{"rendered":"https:\/\/www.sapien.com\/blog\/?p=14690"},"modified":"2018-03-27T17:34:15","modified_gmt":"2018-03-28T00:34:15","slug":"powershell-studio-working-with-powershell-core","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2018\/03\/29\/powershell-studio-working-with-powershell-core\/","title":{"rendered":"PowerShell Studio: Working with PowerShell Core"},"content":{"rendered":"<p>A couple of months ago, <a href=\"https:\/\/blogs.msdn.microsoft.com\/powershell\/2018\/01\/10\/powershell-core-6-0-generally-available-ga-and-supported\/\" target=\"_blank\" rel=\"noopener\">Microsoft announced<\/a> that\u00a0<strong>PowerShell Core<\/strong> had reached the Generally Available (GA) and supported status. Subsequently, we released\u00a0<strong>PowerShell Studio 2018<\/strong>\u00a0which features the ability to build, test, and execute PowerShell Core scripts. As PowerShell Core evolves, SAPIEN Technologies is committed to expand and support PowerShell Core with subsequent builds of our products.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_Logo_01_2018-03-21_16-04-58.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14696\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_Logo_01_2018-03-21_16-04-58-300x72.jpg\" alt=\"\" width=\"484\" height=\"116\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_Logo_01_2018-03-21_16-04-58-300x72.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_Logo_01_2018-03-21_16-04-58.jpg 713w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><\/a><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PowerShell-Core_2017-10-16_22-40-47.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14698\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PowerShell-Core_2017-10-16_22-40-47-181x300.png\" alt=\"\" width=\"70\" height=\"116\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PowerShell-Core_2017-10-16_22-40-47-181x300.png 181w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PowerShell-Core_2017-10-16_22-40-47.png 220w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/><\/a><\/p>\n<p>In this article, we demonstrate how to setup and use PowerShell Core in <strong>PowerShell Studio 2018<\/strong>.<\/p>\n<h3>Setting up PowerShell Core in PowerShell Studio<\/h3>\n<p>If <em>PowerShell Core Version 6.0.1<\/em> is already installed in the system,\u00a0<strong>PowerShell Studio 2018<\/strong> has it detected and ready to use in the <em>Console<\/em> panel:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14702\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58-300x170.jpg\" alt=\"\" width=\"681\" height=\"386\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58-300x170.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58-768x434.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58-1024x579.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58-848x479.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_01_2018-03-21_16-04-58.jpg 1237w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/a><\/p>\n<p>Remember, PowerShell Core will keep evolving. Whenever you upgrade to the next version of PowerShell Core, you will need to manually update the path to the console shell executable (&#8220;<em>pwsh.exe<\/em>&#8220;) in PowerShell Studio.<\/p>\n<blockquote><p>For example, the initial PowerShell Core default path in PowerShell Studio is:<br \/>\n&#8220;<em>C:\\Program Files\\PowerShell\\6.0.1<\/em>&#8221;<\/p>\n<p>But, at the time of this blog post, the latest PowerShell Core version is &#8220;6.1.0-Preview.1&#8221;. You would need to change the default path to:<br \/>\n<em>&#8220;C:\\Program Files\\PowerShell\\6.1.0-Preview.1&#8221;<\/em><\/p><\/blockquote>\n<p>Follow these steps to change the PowerShell Core path in PowerShell Studio:<br \/>\n1. From the <em><strong>Home<\/strong><\/em> tab on the ribbon, select\u00a0<em><strong>Options<\/strong><\/em>.<br \/>\n2. Select\u00a0<em><strong>Console<\/strong><\/em>, and look in the <em><strong>Consoles<\/strong><\/em>\u00a0section.<\/p>\n<p>In the\u00a0<em><strong>Consoles<\/strong><\/em>\u00a0section, the path can be changed, or you can add more console shells to the existing list:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14701\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58-300x120.jpg\" alt=\"\" width=\"680\" height=\"272\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58-300x120.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58-768x307.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58-1024x409.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58-848x339.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_02_2018-03-21_16-04-58.jpg 1918w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>To apply the changes, you will need to save the changes and restart PowerShell Studio.<\/p>\n<h3>Working with PowerShell Core in PowerShell Studio<\/h3>\n<p>Follow these steps to execute PowerShell Core scripts from the PowerShell Studio <em>Console<\/em> panel:<br \/>\n1. Select <em><strong>PowerShell Core 64bit<\/strong><\/em>\u00a0from the Console panel drop-down list.<br \/>\n2. Highlight the code to be executed.<br \/>\n3. Press <strong><em>F8<\/em><\/strong> to <em>Run Selection in Console<\/em>, or <em><strong>right-click<\/strong><\/em> and select <em><strong>Run Selection in Console<\/strong><\/em>.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14704\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58-300x186.jpg\" alt=\"\" width=\"689\" height=\"427\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58-300x186.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58-768x475.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58-1024x633.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58-848x524.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/03\/PSS2018_pwshCore_04_2018-03-21_16-04-58.jpg 1308w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/a><\/p>\n<p>Notice that PowerShell Studio will not execute the <em>*ps1<\/em> file for PowerShell Core scripts. If you press the <em>Run<\/em>\u00a0button it will assume Windows PowerShell and not PowerShell Core.<\/p>\n<p>The ability to <em>Run<\/em>\u00a0and <em>Debug<\/em>\u00a0the PowerShell Core script file will be implemented in a future release.<\/p>\n<h3>Related Links<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.sapien.com\/blog\/2018\/03\/02\/new-video-primalscript-command-window-option\/\">New Video &#8211; PrimalScript Command Window Option<\/a><\/li>\n<li><a href=\"https:\/\/www.sapien.com\/blog\/2018\/01\/22\/sapien-tools-setup-wsl-bash-with-powershell-core-in-primalscript\/\">PrimalScript &#8211; Setup WSL BASH with PowerShell Core<\/a><\/li>\n<li><a href=\"https:\/\/www.sapien.com\/blog\/2018\/01\/17\/sapien-tools-how-to-work-with-powershell-core\/\">How to Work with PowerShell Core in PrimalScript<\/a><\/li>\n<li><a href=\"https:\/\/www.sapien.com\/blog\/2017\/12\/11\/sapien-technologies-on-powershell-core\/\">SAPIEN Technologies on PowerShell Core<\/a><\/li>\n<\/ul>\n<h3>Feedback<\/h3>\n<p>As always, we love to hear from you! Submit your feedback and suggestions in our <a href=\"https:\/\/www.sapien.com\/forums\/viewforum.php?f=23\" target=\"_blank\" rel=\"noopener\">Feedback forum<\/a>.<\/p>\n<p>Submit PowerShell Core feedback and bugs in <a href=\"https:\/\/github.com\/PowerShell\/PowerShell\/issues\" target=\"_blank\" rel=\"noopener\">Github.<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><em>Max Trinidad is a Technology Evangelist at SAPIEN Technologies Inc., and a Microsoft PowerShell MVP. You can reach him at <a href=\"mailto:maxt@sapien.com\">maxt@sapien.com<\/a><\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of months ago, Microsoft announced that\u00a0PowerShell Core had reached the Generally Available (GA) and supported status. Subsequently, we released\u00a0PowerShell Studio 2018\u00a0which features the ability to build, test, and execute PowerShell Core scripts. As PowerShell Core evolves, SAPIEN Technologies is committed to expand and support PowerShell Core with subsequent builds of our products. In [&hellip;]<\/p>\n","protected":false},"author":47,"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,"footnotes":""},"categories":[1054,2,1143,1238,703],"tags":[28,1215,1016,997],"class_list":["post-14690","post","type-post","status-publish","format-standard","hentry","category-automation","category-general","category-powershell","category-powershell-core","category-powershell-studio","tag-powershell","tag-powershell-core","tag-powershell-studio","tag-windows-powershell"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/14690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=14690"}],"version-history":[{"count":23,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/14690\/revisions"}],"predecessor-version":[{"id":14732,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/14690\/revisions\/14732"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=14690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=14690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=14690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}