param( [Parameter(Position=0)][ValidateSet('doctor','sync','snapshot','quick','td','full','status','fetch','logs','cancel','container-up','container-down','container-recreate')][string]$Command='status', [Parameter(ValueFromRemainingArguments=$true)][string[]]$Args ) $ErrorActionPreference='Stop' $root = Split-Path -Parent $PSScriptRoot $invoke = Join-Path $root 'windows\invoke-remote.ps1' if (-not (Test-Path -LiteralPath $invoke)) { throw "missing remote implementation: $invoke" } switch ($Command) { 'doctor' { & (Join-Path $root 'windows\remote-doctor.ps1') @Args } 'status' { & (Join-Path $root 'windows\remote-status.ps1') @Args } 'sync' { # Exact commits stay on the authorized LAN. Preserve the current branch; # a failed SSH push must not silently publish to an unrelated HTTP host. & git push lan HEAD @Args } 'fetch' { & (Join-Path $root 'windows\sync-from-remote.ps1') @Args } default { & $invoke @Args } } exit $LASTEXITCODE