VSCode is the primary way to edit and debug PowerShell scripts on Mac OS and Linux. If you do not have it yet, follow these instructions on GitHub on installing VSCode on Mac OS/Linux/Windows and adding its PowerShell extension.
Once you are done with that, you can create a new or open an existing PS1 file, however, you might still get “No suggestions” error when you try to get intellisense for cmdlets:
This is because this functionality actually requires OpenSSL. Here’s how you add it to your system:
Homebrew is Mac’s most popular package manager. To install it:
- Open a Terminal window,
- Install Mac OS command-line developer tools (xcode) by pasting the following command and pressing Enter:
- Install Homebrew package manager by pasting the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Double-check that the installation is successful by running
Now install OpenSSL on Mac OS by simply pasting the following command to the Terminal window:
brew install openssl
Verify PowerShell cmdlet intellisense in VSCode
- Start VSCode,
- Open a ps1 file or save the file that you have as .ps1,
- Verify that PowerShell is selected as the language mode at the bottom right of the VSCode window:
Get-and you will see the intellisense window popping up with the list of available Get- cmdlets: