| [CmdletBinding()] | |
| param([Parameter(Mandatory=$true)][string]$ProfileId) | |
| $Root = Resolve-Path (Join-Path $PSScriptRoot "..\..") | |
| $Path = Join-Path $Root "config\jackailocal.windows.toml" | |
| $content = Get-Content $Path -Raw | |
| if ($content -match 'default_profile\s*=') { | |
| $content = $content -replace 'default_profile\s*=\s*"[^"]+"', "default_profile = `"$ProfileId`"" | |
| } else { | |
| $content += "`ndefault_profile = `"$ProfileId`"`n" | |
| } | |
| $content | Set-Content -Encoding UTF8 $Path | |