{"id":15476,"date":"2018-08-22T06:00:14","date_gmt":"2018-08-22T13:00:14","guid":{"rendered":"https:\/\/www.sapien.com\/blog\/?p=15476"},"modified":"2018-08-21T10:00:09","modified_gmt":"2018-08-21T17:00:09","slug":"sapien-tools-working-with-powershell-core","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2018\/08\/22\/sapien-tools-working-with-powershell-core\/","title":{"rendered":"SAPIEN Tools &#8211; Working with PowerShell Core"},"content":{"rendered":"<p>As PowerShell Core continues to evolve, SAPIEN Technologies continues to hone our two main editors\u2014<a href=\"https:\/\/www.sapien.com\/software\/primalscript\" target=\"_blank\" rel=\"noopener\">PrimalScript<\/a> and <a href=\"https:\/\/store.sapien.com\/p-366-powershell-studio-2018.aspx\" target=\"_blank\" rel=\"noopener\">PowerShell Studio<\/a>\u2014enhancing them to accommodate PowerShell Core.<\/p>\n<h3>PrimalScript Version 7.4.115<\/h3>\n<p>PrimalScript\u2014our industry-leading Universal Script Environment (USE)\u2014can handle multi-language coding, including Windows PowerShell. We have integrated PowerShell Core support in PrimalScript, allowing you to start scripting and testing the latest releases of either GA (Generally Available) or Preview.<\/p>\n<p>If you work with the GA and the Preview editions of PowerShell Core, PrimalScript will automatically detect both versions and make them available when running scripts (<strong>Home<\/strong> &gt; <strong>Platform<\/strong> &gt; <strong>PowerShell Core<\/strong>).<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15942\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48-300x77.jpg\" alt=\"\" width=\"627\" height=\"161\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48-300x77.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48-768x198.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48-1024x263.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48-848x218.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/07\/PrimalScript_PSCore01_2018-08-16_15-25-48.jpg 1034w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalPScore_01_2018-08-16_16-56-29.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15946\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalPScore_01_2018-08-16_16-56-29.jpg\" alt=\"\" width=\"234\" height=\"122\" \/><\/a><\/p>\n<p>During installation, PrimalScript will also recreate the Console Window entries for any PowerShell Core versions that are already installed.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15943\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48-300x184.jpg\" alt=\"\" width=\"673\" height=\"413\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48-300x184.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48-768x471.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48-1024x627.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48-848x520.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore02_2018-08-16_15-25-48.jpg 1095w\" sizes=\"auto, (max-width: 673px) 100vw, 673px\" \/><\/a><\/p>\n<p>When you click in the <em>Console Window<\/em>\u00a0panel to view the list of all the PowerShell versions available, you will see the existing PowerShell Core versions installed in your system.<\/p>\n<p>To execute the whole script, select the <strong>PowerShell Core<\/strong> button. If you have multiple versions, select one of the versions available and then select <strong>Run Script<\/strong>. The results will be displayed in the Output panel.<\/p>\n<p>To execute the script in the PowerShell Core console:<\/p>\n<ol>\n<li>From the <strong>Console Window pull-down list<\/strong>, select the desired <strong>PowerShell Core<\/strong> version.<\/li>\n<li>On the <strong>Home<\/strong> ribbon &gt; in the\u00a0<strong>Build and Run<\/strong>\u00a0section &gt; select <strong>Run Script<\/strong>\u00a0&gt; then select <strong>Run in Shell<\/strong>. This will execute the script in the active console in the <em>Console Window<\/em>\u00a0panel.<\/li>\n<\/ol>\n<p>The result will be displayed in the selected console.<\/p>\n<p>Note: Remember to first select the PowerShell console from the <em>Console<\/em>\u00a0panel drop-down list.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15945\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48-300x60.jpg\" alt=\"\" width=\"770\" height=\"154\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48-300x60.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48-768x153.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48-1024x203.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48-848x168.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore04_2018-08-16_15-25-48.jpg 1697w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/a><\/p>\n<p>Executing a highlighted block of code can be accomplished in one of two ways:<\/p>\n<ul>\n<li>On the <strong>Home<\/strong> ribbon &gt; in the\u00a0<strong>Build and Run<\/strong>\u00a0section &gt; select\u00a0<strong>Run Script<\/strong>\u00a0&gt; then select <strong>Run Selection in Shell<\/strong>.<\/li>\n<li><strong>Right-click on the highlighted code<\/strong> &gt; then select <strong>Execute Selection in PowerShell<\/strong>.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15944\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48-300x203.jpg\" alt=\"\" width=\"746\" height=\"505\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48-300x203.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48-768x521.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48-1024x694.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48-848x575.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_PSCore03_2018-08-16_15-25-48.jpg 1712w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/a><\/p>\n<p>The code will be executed in the active Console Window.<\/p>\n<h3>PowerShell Studio Version 5.5.154<\/h3>\n<p>PowerShell Studio is the industry-leading PowerShell RAD (Rapid Application Development) tool. This is the Visual Studio for PowerShell for any level of work\u2014perfectly suited for the enterprise\u2014and an essential component of your tool chest.<\/p>\n<p>PowerShell Studio allows you to work with PowerShell Core, and it will find and recognize which version of PowerShell Core is installed on your system. If both the GA (Generally Available) and the Preview are installed, then it will create the link to their executables (<strong>Home<\/strong> ribbon &gt; <strong>Windows<\/strong> section &gt; <strong>Options<\/strong> &gt; <strong>Console<\/strong> tab).<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-22-13.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15952\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-22-13-300x187.jpg\" alt=\"\" width=\"521\" height=\"325\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-22-13-300x187.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-22-13.jpg 606w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/a><\/p>\n<p>Highlight a block of code then select <strong><em>Run Selection in Console<\/em><\/strong>\u00a0to execute the code on the active shell found in the Console panel.<\/p>\n<p>To execute the whole PowerShell Core script, select the <strong>Run<\/strong>\u00a0button.<\/p>\n<p>Note: Remember to select the desired <em>Platform<\/em>.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_01_2018-08-16_17-28-32.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15950\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_01_2018-08-16_17-28-32-300x61.jpg\" alt=\"\" width=\"423\" height=\"86\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_01_2018-08-16_17-28-32-300x61.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_01_2018-08-16_17-28-32.jpg 675w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/a>\u00a0\u00a0<a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_02_2018-08-16_17-28-32.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15951\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_02_2018-08-16_17-28-32-300x91.jpg\" alt=\"\" width=\"415\" height=\"126\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_02_2018-08-16_17-28-32-300x91.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Plat_02_2018-08-16_17-28-32.jpg 676w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15953\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32-300x220.jpg\" alt=\"\" width=\"709\" height=\"520\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32-300x220.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32-768x562.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32-1024x750.jpg 1024w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32-848x621.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Run_012_2018-08-16_17-28-32.jpg 1545w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/a><\/p>\n<p>PowerShell Core is built on .NET Core which does not support Windows Forms. But, if you think outside-of-the-box, you can be creative with PowerShell Studio and overcome this limitation.<\/p>\n<h3>Summary<\/h3>\n<p>To execute PowerShell Core scripts from either PrimalScript or PowerShell Studio:<\/p>\n<ol>\n<li>Setup the PowerShell Core platform.<\/li>\n<li>Select the appropriate PowerShell Core console from the console drop-down list.<\/li>\n<li>Execute the script using either\u00a0<strong>Run Selection in Console<\/strong>\u00a0or <strong>Run in Console<\/strong>.<\/li>\n<\/ol>\n<h3>What&#8217;s Coming!<\/h3>\n<p>We have exciting plans for both PrimalScript and PowerShell Studio, including features and improvements based on your feedback and suggestions. We will also continue to enhance both programs as Microsoft updates and evolves their PowerShell Core products and SDK&#8217;s.<\/p>\n<p>A note about console shell updates: Both PrimalScript and PowerShell Studio will detect and update the PowerShell Core console when a newer version is installed. To manually update:<\/p>\n<ul>\n<li>PrimalScript: <strong>File<\/strong> &gt; <strong>Options<\/strong> &gt; <strong>Command Window<\/strong> tab &gt;\u00a0<strong>Rescan<\/strong><\/li>\n<li>PowerShell Studio:\u00a0<strong>Home<\/strong> ribbon &gt; <strong>Windows<\/strong> section &gt; <strong>Options<\/strong> &gt; <strong>Console<\/strong> tab &gt;\u00a0<strong>Reset<\/strong><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_Option_01_2018-08-16_17-15-37.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15948\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_Option_01_2018-08-16_17-15-37-300x147.jpg\" alt=\"\" width=\"508\" height=\"249\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_Option_01_2018-08-16_17-15-37-300x147.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_Option_01_2018-08-16_17-15-37-768x377.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_Option_01_2018-08-16_17-15-37-848x417.jpg 848w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PrimalScript_Option_01_2018-08-16_17-15-37.jpg 863w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/>\u00a0<\/a><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-15-37.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15949\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-15-37-300x155.jpg\" alt=\"\" width=\"480\" height=\"248\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-15-37-300x155.jpg 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-15-37-768x396.jpg 768w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2018\/08\/PStudio_Option_01_2018-08-16_17-15-37.jpg 793w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>Stay tuned for more product improvements in the upcoming service releases.<\/p>\n<h3>For more information<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.sapien.com\/software\/primalscript\" target=\"_blank\" rel=\"noopener\">PrimalScript 2018<\/a><\/li>\n<li><a href=\"https:\/\/www.sapien.com\/software\/powershell_studio\" target=\"_blank\" rel=\"noopener\">Powershell Studio 2018<\/a><\/li>\n<\/ul>\n<h3>Related Articles<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=iGD7cuGvbSA\" target=\"_blank\" rel=\"noopener\">Which Is Right For You! SAPIEN&#8217;s PrimalScript or PowerShell Studio<\/a><\/li>\n<li><a href=\"https:\/\/www.sapien.com\/blog\/2018\/08\/14\/powershell-studio-2018-service-release-v5-5-154-and-pscore-support\/\">PowerShell Studio 2018: Service Release v5.5.154 and PSCore Support<\/a><\/li>\n<\/ul>\n<h3>Feedback<\/h3>\n<p>As always, if you have any ideas, comments, or feedback, please\u00a0<a href=\"https:\/\/www.sapien.com\/forums\/viewforum.php?f=23\" target=\"_blank\" rel=\"noopener\">visit our feedback forum<\/a>\u00a0and reference this post.<\/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\u00a0<a href=\"mailto:maxt@sapien.com\">maxt@sapien.com<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As PowerShell Core continues to evolve, SAPIEN Technologies continues to hone our two main editors\u2014PrimalScript and PowerShell Studio\u2014enhancing them to accommodate PowerShell Core. PrimalScript Version 7.4.115 PrimalScript\u2014our industry-leading Universal Script Environment (USE)\u2014can handle multi-language coding, including Windows PowerShell. We have integrated PowerShell Core support in PrimalScript, allowing you to start scripting and testing the latest [&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":[1143,1238,703,410],"tags":[28,1215,1016,37],"class_list":["post-15476","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-core","category-powershell-studio","category-primalscript-software-news","tag-powershell","tag-powershell-core","tag-powershell-studio","tag-primalscript"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/15476","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=15476"}],"version-history":[{"count":32,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/15476\/revisions"}],"predecessor-version":[{"id":15983,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/15476\/revisions\/15983"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=15476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=15476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=15476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}