File size: 471 Bytes
f25362a
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
[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