Working with PowerShell Core
- Written by Max Trinidad
- Last Updated: 09 October 2019
- Created: 29 March 2018
- Hits: 447
In this article, we demonstrate how to setup and use PowerShell Core in PowerShell Studio 2018.
Setting up PowerShell Core in PowerShell Studio
If PowerShell Core is already installed on your system, PowerShell Studio has already detected it and it is ready to use in the Console panel:
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 ("pwsh.exe") in PowerShell Studio.
For example, the initial PowerShell Core default path in PowerShell Studio is:
But, at the time of this article, the latest PowerShell Core version is "6.1.0-Preview.1". You would need to change the default path to:
Follow these steps to change the PowerShell Core path in PowerShell Studio:
1. From the Home tab on the ribbon, select Options.
2. Select Console, and look in the Consoles section.
In the Consoles section, the path can be changed, or you can add more console shells to the existing list:
To apply the changes, you will need to save the changes and restart PowerShell Studio.
Working with PowerShell Core in PowerShell Studio
Follow these steps to execute PowerShell Core scripts from the PowerShell Studio Console panel:
1. Select PowerShell Core 64bit from the Console panel drop-down list.
2. Highlight the code to be executed.
3. Press F8 to Run Selection in Console, or right-click and select Run Selection in Console.
Notice that PowerShell Studio will not execute the *ps1 file for PowerShell Core scripts. If you press the Run button it will assume Windows PowerShell and not PowerShell Core.
The ability to Run and Debug the PowerShell Core script file will be implemented in a future release.
- Command Window Option
- PrimalScript – Setup WSL BASH with PowerShell Core
- How to Work with PowerShell Core in PrimalScript
- SAPIEN Technologies on PowerShell Core