Install the PowerShell VS Code Extension
It's quick and easy to install the PowerShell Visual Studio Code extension. Instructions are here: https://docs.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/using-vscode?view=powershell-7.2
Choosing a version of PowerShell to use with VS Code
If you have PowerShell installed on the same PC as Windows PowerShell, you can use a specific version of PowerShell with the extension.
Use the following steps to choose your version:
Open the Command Palette with Ctrl+Shift+P
Search for Session
Click on PowerShell: Show Session Menu
Choose the version of PowerShell you want to use from the list
If you installed PowerShell to a non-typical location, it might not show up initially in the Session Menu. You can extend the session menu by adding your own PoSh paths
Editing VS Code User Settings (e.g. change the color scheme to the PowerShell ISE scheme)
The VS Code makes it really easy to dump JSON keys into the user settings file customize your VS Code experience or you can select the options you want one-by-one from the Command Palette (F1 or Ctrl+Shift+P).
JSON Method
To open the User settings JSON file:
Open the Command Palette (F1 or Ctrl+Shift+P)
Type "open settings"
You are presented with two options, choose Open Settings (JSON)
On Windows, the settings file you are editing is found here: %APPDATA%\Code\User\settings.json
The JSON below will produce the ISE color scheme
{
"workbench.colorTheme": "PowerShell ISE"
}
Command Palette Method
In the Command Palette ( F1 or Ctrl+Shift+P), type "theme" to get Preferences: Color Theme and press Enter. In the drop-down list, select "PowerShell ISE." This produces the same JSON key as the manual JSON method above.
Introduction to Debugging PowerShell Scripts in VS Code
Microsoft's DevBlogs site has two good articles on how to use the VS Code debugger when in the PoSh extension:
https://devblogs.microsoft.com/scripting/debugging-powershell-script-in-visual-studio-code-part-1/
https://devblogs.microsoft.com/scripting/debugging-powershell-script-in-visual-studio-code-part-2/