Back in May 2016, SAPIEN published an article about Using Bash with PrimalScript 2016. In a way, using similar steps, we can setup and use PowerShell Core in PrimalScript 2017 as well.
Keep in mind, due to the fact that PowerShell Core is still in it’s early stages, you’ll have modify the console executable path each time you install the updated version of PowerShell Core: “C:\Program Files\PowerShell\x.0.0-xxxx-x“.
Another thing, PowerShell Core still is progressing in its Beta stage. So, SAPIEN won’t support any issues found with PowerShell Core until it reaches RTM status. If you find any issues with “PowerShell Core”, please send them directly to their Github link.
By default PrimalScript, will execute the PowerShell script(s) under Windows PowerShell. In order allow execution of PowerShell Core scripts, we need to add the PowerShell Core executable in their list of “Command Window“.
Before executing the code, you’ll need to open the PowerShell Core console:
Remember, PrimalScript will let you create PowerShell Core script(s), but there are a few limitations:
The workaround for executing the code automatically, is to execute the following command:Remove-Module PSReadLine
Now you can create and test your code without any problem.
Please, feel free to give it a try!