jackailocal / factory /powershell /Set-DefaultModel.ps1
jackboy70's picture
Deploy: accurate lite-builder note
f25362a
Raw
History Blame Contribute Delete
471 Bytes
[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