In a previous blog post, I demonstrated how to configure Visual Studio Code by installing the necessary extensions and adjusting the settings specifically for PowerShell development.
If you happen to use Visual Studio Code across multiple computers, different work environments, or various lab machines, it can quickly become a tedious and time-consuming task to set up everything individually on each device.
Fortunately, there are much easier and more efficient methods to streamline this process.
Begin by setting up all your preferred settings, installing all required extensions, and customizing any snippets you want directly in your Visual Studio Code environment first.
In this guide, I will demonstrate two methods. Later, I will also show how to automate the process using scripts.
All the code and information provided on this website are offered “as is” without any guarantees or warranties of any kind. Although the code and information are tested, we do not warrant that the code is error-free or that it will meet your specific requirements. Use the code at your own risk. We disclaim all liability for any damages or losses arising from the use or inability to use the provided materials.
Profiles
If you want to share your VSCode setup with others or prefer not to log in to your GitHub or Microsoft account, you can use profiles.
Profiles allow you to export and import the following settings:
- Contents
- Settings
- Keyboard Shortcuts
- Tasks
- Snippets
- Extensions

Create
Easiest way to create a profile for export is to go to Manage -> Profiles.
Click on Default profile and click on the three dots.
And then Duplicate…
Now you will get a copy of the Default profile.
Rename it by changing the Name and then press the button Create.

Export
Now it’s time to Export the profile and here you have two options.
GitHub (gist) and Local (file).
GitHub
When exporting to GitHub (gist) you need to sign in to your GitHub account.

Click allow and then you need to login to GitHub.

And Authorize Visual Studio Code

Copy the link and save it.
Local
Just choose a name and where to save your profile and click Save.


Import
On a new computer you just need to install Visual Studio Code and then go to Profiles and click on the arrow right to New Profile and choose Import Profile…
GitHub

Just copy the url to your profile and paste it in the box for Profile Template URL and press Enter.
Local

For local just press Select File… and locate your saved profile file.
Create
And then it’s the same for GitHub profile or Local file.

And press Create
Now you will get some popups regarding trusting publishers.
These are for the extensions you have in your exported profile.
Choose Trust Publishers and Install
It will take some time before it has created the profile.
To use it you need to click on the Use button right to your profile

Now you will see all extensions, snippets and settings that you exported.
Settings Sync
If you can and want to login with your GitHub or Microsoft account you can sync your settings with Settings Sync.
This are a bit easier. You do Backup and Sync first on your perfect setup and then you can Sync it to other computers where you have Visual Studio Code Installed.
Note that syncing between your lab and office/work computers will apply changes to both, so be mindful when syncing across different environments.

Go to Manage and then Backup and Sync Settings.
Choose what to backup and Sync and then Click on Sign In.

Choose the option you prefer to Sign In with.
For this example, I will choose GitHub.
Next, you will need to Sign In to your GitHub account, then Authorize the application, and finally click Continue.
Wait patiently while Visual Studio Code completes the Backup and Sync process. After that, navigate to Manage, and you should see the message Settings Sync is On.
Now you can move to another computer and perform the sync there as well.
If you have created a profile, make sure to go to Profiles and set it as active.
And that’s all there is to it!
The End
I sincerely hope you find this guide helpful and informative.
The two methods described here have been incredibly useful for me, especially when I am transitioning from one customer site to another or working on different Lab computers.
I tend to using the Profile option because I prefer not to log in with my GitHub or Microsoft account on Lab computers or within customer environments for security and privacy reasons.
Leave a Reply