Skip to content

One Zero One

Code for Your Node

  • Home
  • Posts
  • Contact

Update Visual Studio Code Updates Settings with PowerShell

  1. Home
  2. Update Visual Studio Code Updates Settings with PowerShell
  • Andy Lievertz
  • June 2, 2022
  • 0
Posted in PowerShell, Scripting, Systems Administration, WindowsTagged in deployment, microsoft, Visual Studio Code, vscode, windows

On Windows systems, Visual Studio Code settings are stored in a subfolder of the User profile.

%APPDATA%\Code\User\settings.json

There is no global settings file, so if you are deploying in an enterprise environment where updates are managed with something like Microsoft Endpoint Manager (Intune), you might wish to disable VSCode’s update check so it doesn’t nag your users who may not have the ability to install the update.

This block of PowerShell iterates through C:\Users looking for VSCode settings files in the Users’ profiles. If it finds one, it adds or updates update.mode:none.

ForEach ($user in (Get-ChildItem -Path "C:\Users")) {
        $jsonPath = "C:\Users\" + $user.Name + "\AppData\Roaming\Code\User\settings.json"
        If (Test-Path "$jsonPath") {
            $json = Get-Content "$jsonPath" -Raw | ConvertFrom-Json
            $json | Add-Member -Force -MemberType NoteProperty -Name "update.mode" -Value "none"
            $json | ConvertTo-Json | Out-File "$jsonPath" -Encoding utf8
        }
    }
  • Share:  
  • Facebook
  • Twitter
  • Google+

Andy Lievertz

View all posts by Andy Lievertz | Website

Previous post

Demystifying Microsoft Endpoint Manager Win32 App Deployments

Next post

WordPress on LAMP with Session Encryption and Backup

Copyright © 2023 | All Rights Reserved.

Loading