feat: add Windows PowerShell setup script#31
Conversation
PowerShell equivalent of setup.sh covering the same steps: Node.js 20+ / Terraform / AWS CLI prerequisite checks with winget-based auto-install, npm ci + Lambda bundle build, S3 + DynamoDB Terraform backend bootstrap, and terraform init with optional state migration. https://claude.ai/code/session_01LHDg9ZNoZmERqW6zAN61bj
Update the prerequisites table, clone-and-bootstrap section, and repository map to cover the new Windows PowerShell setup script, including the execution-policy note for first-time Windows users. https://claude.ai/code/session_01LHDg9ZNoZmERqW6zAN61bj
There was a problem hiding this comment.
Pull request overview
Adds a Windows PowerShell bootstrap script to give Windows developers a one-command setup path equivalent to the existing setup.sh, covering prerequisites, JS workspace install/build, and Terraform backend bootstrapping + init.
Changes:
- Add
setup.ps1implementing Windows-native setup flow (prereq checks/installs,npm ci, Lambda bundle build, S3+DynamoDB backend bootstrap). - Parse
terraform/terraform.tfvarsto derive backend bucket/table names and region. - Run
terraform initwith optional local→S3 state migration.
| npm ci | ||
|
|
||
| Write-Host "" | ||
| Write-Host " Building Lambda bundles..." | ||
| npm run build:lambdas |
There was a problem hiding this comment.
$ErrorActionPreference='Stop' does not stop execution when a native command (npm/aws/terraform/winget/etc.) exits non-zero in PowerShell 5.1, so the script can continue and print "Setup complete" even after failures. Consider wrapping native invocations in a helper that throws on non-zero $LASTEXITCODE (or explicitly checking $LASTEXITCODE after each critical command).
There was a problem hiding this comment.
Fixed in b32a077. Added an Invoke-Native helper that calls & $Block then throws if $LASTEXITCODE -ne 0, and wrapped every native invocation (winget, npm ci, npm run build:lambdas, all aws calls, and both terraform init variants) with it.
Generated by Claude Code
| $ScriptDir = $PSScriptRoot | ||
|
|
||
| Write-Host "" | ||
| Write-Host " Game Server Manager - Setup" |
There was a problem hiding this comment.
PR title doesn’t follow the repo’s Conventional Commits requirement for squash-merge (it should start with a type like feat/fix/chore, optional scope, then ":"). Please retitle to something like "chore(setup): add Windows PowerShell setup script" (or another appropriate type/scope) so the merge commit subject is well-formed (see CONTRIBUTING.md "PR titles").
There was a problem hiding this comment.
$ErrorActionPreference='Stop' only traps cmdlet errors in PowerShell 5.1, not native executable exit codes. Add an Invoke-Native wrapper that checks $LASTEXITCODE after every native call (winget, npm, aws, terraform) and throws immediately on failure so the script can't silently reach "Setup complete" after a partial failure. https://claude.ai/code/session_01LHDg9ZNoZmERqW6zAN61bj
Summary
Add a PowerShell equivalent of the existing
setup.shscript to enable Windows developers to set up the Game Server Manager project with a single command.Key Changes
setup.ps1script that provides Windows-native setup automation with the following functionality:wingetwhere available, with fallback to manual download for AWS CLIImplementation Details
$ErrorActionPreference = 'Stop')terraform.tfvarsto extract project name and AWS region for backend configurationus-east-1)https://claude.ai/code/session_01LHDg9ZNoZmERqW6zAN61bj