Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ninmonkey/8aff24ebc826e9a602311747ceb67059 to your computer and use it in GitHub Desktop.
Save ninmonkey/8aff24ebc826e9a602311747ceb67059 to your computer and use it in GitHub Desktop.
cheat sheet - VS Code, Wt, etc config files

Windows 10

App Note Path
VS Code Global config $Env:APPDATA\Code\User\Settings.json
VS Code - Insiders Global config $Env:APPDATA\Code - Insiders\User\Settings.json
VS Code Extensions Dir $env:UserProfile\.vscode\extensions
Wt Preview see Get-WindowsTerminalProfile.ps1 $env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\settings.json

Profile in 'wt' (ie: regular)

PS> $PSVersionTable | % PSVersion | % tostring
7.1.2
PS> $profile | select *

AllUsersAllHosts       : C:\Program Files\PowerShell\7\profile.ps1                                                         
AllUsersCurrentHost    : C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1                                    
CurrentUserAllHosts    : C:\Users\<username>\Documents\PowerShell\profile.ps1                                               
CurrentUserCurrentHost : C:\Users\<username>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1                          
PSReadLineHistoryPath  : C:\Users\<username>\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

Profile in VS Code (powershell extension)

PS> $PSVersionTable | % PSVersion | % tostring
7.1.2
PS> $profile | select *

AllUsersAllHosts       : C:\Program Files\PowerShell\7\profile.ps1
AllUsersCurrentHost    : C:\Program Files\PowerShell\7\Microsoft.VSCode_profile.ps1
CurrentUserAllHosts    : C:\Users\<username>\Documents\PowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\<username>\Documents\PowerShell\Microsoft.VSCode_profile.ps1
PSReadLineHistoryPath  : C:\Users\<username>\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\Visual Studio Code Host_history.txt
# Requires WindowsPowershell (powershell.exe),
# because AppX does not import in Powershell (pwsh.exe) (yet)
function Get-WtConfig {
<#
.synopsis
Find Windows terminal (and preview) config files
.example
PS> Get-WtConfig
# output:
# C:\Users\<username>\AppData\Local\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\settings.json
.notes
my directory: WindowsTerminalPreview_8wekyb3d8bbwe
matches the AppX Family name
PackageFamilyName : Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe
#>
$appxWt = Get-AppxPackage *windowsterminal*
$appxWt.PackageFamilyName | %{
$family = $_
"$env:localappdata\Packages\$family\LocalState\settings.json"
} | gi -ea Continue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment