Functions/Backup-VsCodeSettings.ps1
function Backup-VsCodeSettings { [CmdletBinding()] param ( [Parameter()] [string] $SettingsPath = "$($env:APPDATA)\Code\User\settings.json", [Parameter()] [string] $BackupPath = "$($env:OneDrive)\Backup\vscode\$($env:computername)_settings.json" ) if(-not(Test-Path $SettingsPath)) { Write-Error "Settings file not found at `"$($SettingsPath)" break } if(-not(Test-Path $BackupPath)) { New-Item $BackupPath -Force | Out-Null } Copy-Item $SettingsPath $BackupPath -Force -PassThru } |