Visual Studio Code: PowerShell Profile



Microsoft has released a terrific open source, multi-platform code editor called Visual Studio Code. If you want to get started with VS Code, I would recommend watching the videos provided here and then watch this excellent video about replacing PowerShell ISE with Visual Studio Code by Mike Robbins.

What about the PowerShell profile?

While Visual Studio Code can use PowerShell as its terminal, it does not use any previously setup PowerShell profile. In order to create a VS Code PowerShell profile (or VSCPP for short), select the Terminal (make sure it says PowerShell Integrated in the drop down on the right) and type $profile.


In order to create this file, you can type PS>notepad $profile in the terminal. This will open notepad and let you create the file. You can add whatever settings you prefer to in PowerShell. Once you save the profile, hit F1 or Ctrl+Shift+P to bring up the Command Palette and type Reload Window.


When the reload completes, create a new PowerShell file in VS Code and you should see the Terminal switch to PowerShell Integrated and load your newly created VSCPP (this assumes you have installed the PowerShell extension into VS Code).


NOTE: The PowerShell version that is installed as an extension into VS Code, has its own version.


If you have modules, scripts, or functions that have a dependency on a certain version of PowerShell, you will have to change, comment, or remove the dependency in order to use them in Visual Studio Code.

Happy Scripting!

8 thoughts on “Visual Studio Code: PowerShell Profile”

  1. Am in the process described above; BUT now my ‘ordinary Powershell’ can’t find the $profile start-up file (:-( and as I copied to much to the new $profile start-up file, this furthermore is tragic (get errors when starting VS Code). So all in all it’s just not working for me. NOW, how can I roll it all back? (I have really tried everything) 🙂

    1. Start at the top of your $profle file and comment everything out. You can use # to comment out a single line or to comment out multiple lines. Then add back 1 or 2 lines at a time until the profile fails to load. Then you can zero-in on what is wrong with that line (or lines) of code.

  2. Is there a way to just use VSCode to point at the existing powershell profile that you’ve already created? It seems like with how much VS Code has available for customization – that we should be able to do this.

    1. Since it is a different name you cannot as far as I know. I would just copy the contents of your regular PowerShell profile into your one for VSCode. You may want to add a time/date check to the VSCode profile so you know when to resync them.

  3. Is there a way to just point at the PowerShell profile that you’ve already created so as to not have to maintain two profiles? Seems not awesome.

  4. Excellent blog post as I didn’t know how to edit the profile. Working with the PowerShell preview team, I will pass on their suggestions: replace notepad and edit the profile in VSCode Open-EditorFile $profile or New-EditorFile $profile which creates the file if it doesn’t exist. Thanks again for posting

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.