Claude Skill

powershell-windows

PowerShell scripting rules for Windows environment. Use when running shell commands, Docker operations, or HTTP requests on Windows PowerShell.

LLM Mart · 0 points · 11 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download Desko77-claude-code-skills-1c-skills_powershell-windows-eb281b4.zip · 2 KB
Part of desko77/claude-code-skills-1c — 48 skills

Install

skills CLI npx skills add https://github.com/Desko77/claude-code-skills-1c/tree/main/skills/powershell-windows
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install desko77-claude-code-skills-1c@llmmart
Git git clone https://github.com/Desko77/claude-code-skills-1c.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole desko77/claude-code-skills-1c collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

PowerShell Windows - Scripting Rules

Essential rules for correct PowerShell usage on Windows. Follow these rules to avoid common errors when executing shell commands.

Core Principles

1. Command Separation

  • Wrong: cd "path" && command (bash syntax)
  • Correct: cd "path"; command (PowerShell syntax)

2. Path Quoting

  • Always use double quotes for paths with spaces:
    cd "D:\My Projects\MyApp"
    

3. Script Execution

  • For .bat/.cmd files:
    ./gradlew clean build
    .\gradlew.bat clean build
    

4. Docker Commands

  • Specify full path to docker-compose files:
    docker-compose -f "D:\My Projects\app\docker-compose.yml" up -d
    

5. HTTP Requests

  • Wrong: curl -s http://localhost:9090/status
  • Correct:
    Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
    

6. Waiting/Delays

  • Wrong: timeout 10
  • Correct:
    Start-Sleep -Seconds 10
    

7. JSON Handling

  • JSON parsing:
    $response = Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
    $json = $response.Content | ConvertFrom-Json
    $json | ConvertTo-Json -Depth 3
    

8. Process Checking

  • Process search:
    Get-Process -Name "java" -ErrorAction SilentlyContinue
    

9. Docker Operations

  • Stop containers:
    docker-compose -f "path\to\file.yml" down
    
  • Build images:
    docker-compose -f "path\to\file.yml" build --no-cache
    

10. Error Handling

  • Ignore errors:
    Get-Process -Name "java" -ErrorAction SilentlyContinue
    

Common Errors and Fixes

Error Cause Fix
&& is not recognized Using bash syntax Replace && with ;
curl not found curl not installed on Windows Use Invoke-WebRequest
timeout not found timeout not supported Use Start-Sleep
Path not found Missing quotes on spaced path Wrap path in double quotes

Correct Command Examples

# Change directory and execute command
cd "D:\My Projects\MyApp"; ./gradlew clean build -x test

# Wait and make HTTP request
Start-Sleep -Seconds 10; Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing

# Docker operations
docker-compose -f "D:\My Projects\MyApp\docker-compose.yml" down
docker-compose -f "D:\My Projects\MyApp\docker-compose.yml" build --no-cache
docker-compose -f "D:\My Projects\MyApp\docker-compose.yml" up -d

# Check server status
$response = Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
$json = $response.Content | ConvertFrom-Json
Write-Host "Transport: $($json.mcp.transport)"

These rules are critically important for proper operation in Windows PowerShell environment.

Files (claude-code-skills-1c)
  • evals
    • evals.json 2.8 KB
      {
        "skill_name": "powershell-windows",
        "evals": [
          {
            "id": 1,
            "prompt": "Как выполнить HTTP-запрос к http://localhost:8080/api/status и вывести JSON-поле version на Windows PowerShell?",
            "expected_output": "Приведён PowerShell-код с Invoke-WebRequest (не curl), парсингом JSON через ConvertFrom-Json и выводом нужного поля.",
            "expectations": [
              "Использован Invoke-WebRequest с параметром -UseBasicParsing вместо curl",
              "Парсинг JSON выполнен через ConvertFrom-Json (не jq или внешние утилиты)",
              "Приведён синтаксис доступа к полю JSON через $json.version или аналогичный",
              "Не использован bash-синтаксис (&&, grep, curl)"
            ]
          },
          {
            "id": 2,
            "prompt": "Напиши PowerShell-команду: перейти в папку 'D:\\My Projects\\MyApp', подождать 5 секунд, затем запустить gradlew clean build.",
            "expected_output": "Приведён PowerShell-код: cd с двойными кавычками для пути с пробелами, точка с запятой как разделитель команд, Start-Sleep -Seconds 5, ./gradlew clean build.",
            "expectations": [
              "Используется точка с запятой ; как разделитель команд (не && из bash)",
              "Путь с пробелами обёрнут в двойные кавычки",
              "Ожидание реализовано через Start-Sleep -Seconds 5 (не через timeout)",
              "Команда gradlew вызвана как ./gradlew или .\\gradlew.bat"
            ]
          },
          {
            "id": 3,
            "prompt": "Как поднять Docker-контейнер из файла 'D:\\Projects\\App\\docker-compose.yml' и проверить, что процесс java запущен?",
            "expected_output": "Приведён PowerShell-код: docker-compose с -f и полным путём в двойных кавычках, up -d, затем Get-Process -Name java с -ErrorAction SilentlyContinue.",
            "expectations": [
              "docker-compose вызван с флагом -f и полным путём к файлу в двойных кавычках",
              "Команда docker-compose up содержит флаг -d для фонового запуска",
              "Проверка процесса выполнена через Get-Process -Name java (не через ps или grep)",
              "Использован параметр -ErrorAction SilentlyContinue для обработки случая, когда процесс не найден"
            ]
          }
        ]
      }
      
  • SKILL.md 3 KB
    ---
    name: powershell-windows
    description: "PowerShell scripting rules for Windows environment. Use when running shell commands, Docker operations, or HTTP requests on Windows PowerShell."
    ---
    
    # PowerShell Windows - Scripting Rules
    
    Essential rules for correct PowerShell usage on Windows. Follow these rules to avoid common errors when executing shell commands.
    
    ## Core Principles
    
    ### 1. Command Separation
    - **Wrong**: `cd "path" && command` (bash syntax)
    - **Correct**: `cd "path"; command` (PowerShell syntax)
    
    ### 2. Path Quoting
    - **Always use double quotes** for paths with spaces:
      ```powershell
      cd "D:\My Projects\MyApp"
      ```
    
    ### 3. Script Execution
    - For .bat/.cmd files:
      ```powershell
      ./gradlew clean build
      .\gradlew.bat clean build
      ```
    
    ### 4. Docker Commands
    - Specify full path to docker-compose files:
      ```powershell
      docker-compose -f "D:\My Projects\app\docker-compose.yml" up -d
      ```
    
    ### 5. HTTP Requests
    - **Wrong**: `curl -s http://localhost:9090/status`
    - **Correct**:
      ```powershell
      Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
      ```
    
    ### 6. Waiting/Delays
    - **Wrong**: `timeout 10`
    - **Correct**:
      ```powershell
      Start-Sleep -Seconds 10
      ```
    
    ### 7. JSON Handling
    - JSON parsing:
      ```powershell
      $response = Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
      $json = $response.Content | ConvertFrom-Json
      $json | ConvertTo-Json -Depth 3
      ```
    
    ### 8. Process Checking
    - Process search:
      ```powershell
      Get-Process -Name "java" -ErrorAction SilentlyContinue
      ```
    
    ### 9. Docker Operations
    - Stop containers:
      ```powershell
      docker-compose -f "path\to\file.yml" down
      ```
    - Build images:
      ```powershell
      docker-compose -f "path\to\file.yml" build --no-cache
      ```
    
    ### 10. Error Handling
    - Ignore errors:
      ```powershell
      Get-Process -Name "java" -ErrorAction SilentlyContinue
      ```
    
    ## Common Errors and Fixes
    
    | Error | Cause | Fix |
    |-------|-------|-----|
    | `&& is not recognized` | Using bash syntax | Replace `&&` with `;` |
    | `curl not found` | curl not installed on Windows | Use `Invoke-WebRequest` |
    | `timeout not found` | timeout not supported | Use `Start-Sleep` |
    | `Path not found` | Missing quotes on spaced path | Wrap path in double quotes |
    
    ## Correct Command Examples
    
    ```powershell
    # Change directory and execute command
    cd "D:\My Projects\MyApp"; ./gradlew clean build -x test
    
    # Wait and make HTTP request
    Start-Sleep -Seconds 10; Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
    
    # Docker operations
    docker-compose -f "D:\My Projects\MyApp\docker-compose.yml" down
    docker-compose -f "D:\My Projects\MyApp\docker-compose.yml" build --no-cache
    docker-compose -f "D:\My Projects\MyApp\docker-compose.yml" up -d
    
    # Check server status
    $response = Invoke-WebRequest -Uri "http://localhost:9090/status" -UseBasicParsing
    $json = $response.Content | ConvertFrom-Json
    Write-Host "Transport: $($json.mcp.transport)"
    ```
    
    These rules are critically important for proper operation in Windows PowerShell environment.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related