scripts/setup-windows.cmd¶
Platforms: Windows.
Purpose¶
setup-windows.cmd is a one-line cmd.exe wrapper that launches
setup-windows.ps1 with the correct execution policy,
so operators do not have to remember to pass -ExecutionPolicy themselves. It
forwards all arguments through to the PowerShell script unchanged.
Requirements¶
- Native Windows with
cmd.exe. - PowerShell 7 (
pwsh) onPATH— the wrapper invokespwsh, not Windows PowerShell 5.1. Ifpwshis missing, runprereqs-windows.ps1first. - All prerequisites required by
setup-windows.ps1itself.
Usage¶
scripts\setup-windows.cmd -NewChain -UpnSuffix winagent
scripts\setup-windows.cmd -UseBlueprint <BLUEPRINT_APP_ID> -AgentUserUpn <UPN>
scripts\setup-windows.cmd -Status -Json
Effects¶
- Runs:
where %~dp0 resolves to the wrapper's own directory (so it always finds the
sibling setup-windows.ps1) and %* forwards every argument.
- -ExecutionPolicy Bypass avoids an execution-policy prompt for this
invocation only; it does not change the machine or user policy.
- -NoProfile skips PowerShell profile scripts for a clean, reproducible run.
- All real work — prerequisite probing, provisioning, certificate generation,
.env writing, and MCP registration — happens inside
setup-windows.ps1; this wrapper adds no behavior of
its own.
Exit behavior¶
- The wrapper's exit code is that of the
pwsh/setup-windows.ps1process it launches. See thesetup-windows.ps1exit behavior (0success,1fatal/refusal,2mutually exclusive storage flags, and the underlying status exit code under-Status).
Common failures¶
'pwsh' is not recognized— PowerShell 7 is not installed or not onPATH. Install it withprereqs-windows.ps1, then reopen the terminal.
Related commands¶
- Script reference — Setup
setup-windows.ps1— the script this wrapper invokes.prereqs-windows.ps1— installspwshand the rest of the Windows prerequisites.- Windows installation.