spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

Apply review suggestions: Add ValidateSet and improve documentationBrowse files
Masa1984a authored on Jul 2, 2025 parent 11cfc05 · commit 545d78c331ed
1 changed file+28 -32compared with 11cfc05
MScript/run_devcontainer_claude_code.ps1
@@ -1,31 +1,34 @@
1-#------------------------------------------------------------------------------
2-# Script: run_devcontainer_claude_code.ps1
3-# Author: [Your Name or Project Name]
4-# Description: Automates the setup and connection to a DevContainer environment
5-# using either Docker or Podman on Windows.
6-#
7-# IMPORTANT USAGE REQUIREMENT:
8-# This script MUST be executed from the ROOT directory of your project.
9-# It assumes the script file itself is located in a 'Script' subdirectory.
10-#
11-# Assumed Project Structure:
12-# Project/
13-# ├── .devcontainer/
14-# └── Script/
15-# └── run_devcontainer_claude_code.ps1 <-- This script's location
16-#
17-# How to Run:
18-# 1. Open PowerShell.
19-# 2. Change your current directory to the project root:
20-# cd c:\path\to\your\Project
21-# 3. Execute the script, specifying the container backend:
22-# .\Script\run_devcontainer_claude_code.ps1 -Backend <docker|podman>
23-#
24-# The -Backend parameter is mandatory and accepts 'docker' or 'podman'.
25-#------------------------------------------------------------------------------
1+<#
2+.SYNOPSIS
3+ Automates the setup and connection to a DevContainer environment using either Docker or Podman on Windows.
4+
5+.DESCRIPTION
6+ This script automates the process of initializing, starting, and connecting to a DevContainer
7+ using either Docker or Podman as the container backend. It must be executed from the root
8+ directory of your project and assumes the script is located in a 'Script' subdirectory.
9+
10+.PARAMETER Backend
11+ Specifies the container backend to use. Valid values are 'docker' or 'podman'.
12+
13+.EXAMPLE
14+ .\Script\run_devcontainer_claude_code.ps1 -Backend docker
15+ Uses Docker as the container backend.
16+
17+.EXAMPLE
18+ .\Script\run_devcontainer_claude_code.ps1 -Backend podman
19+ Uses Podman as the container backend.
20+
21+.NOTES
22+ Project Structure:
23+ Project/
24+ ├── .devcontainer/
25+ └── Script/
26+ └── run_devcontainer_claude_code.ps1
27+#>
2628 [CmdletBinding()]
2729 param(
2830 [Parameter(Mandatory=$true)]
31+ [ValidateSet('docker','podman')]
2932 [string]$Backend
3033 )
3134
@@ -33,13 +36,6 @@
3336 Write-Host "--- DevContainer Startup & Connection Script ---"
3437 Write-Host "Using backend: $($Backend)"
3538
36-# Validate the input backend
37-if ($Backend -notin @('docker', 'podman')) {
38- Write-Error "Invalid backend specified. Please use 'docker' or 'podman'."
39- Write-Host "Usage: ." + $MyInvocation.MyCommand.Definition + " -Backend <docker|podman>"
40- exit 1
41-}
42-
4339 # --- Backend-Specific Initialization ---
4440 if ($Backend -eq 'podman') {
4541 Write-Host "--- Podman Backend Initialization ---"