agentleFS
wrm3wrm3/ai_project_template/.cursor/rules/powershell.mdc

ai_project_template / rules

Cursor rule1 starsChanged 12 months agoMITView on GitHub

CRITICAL: In PowerShell on Windows, curl is an alias for Invoke-WebRequest cmdlet, NOT the actual curl executable. This causes interactive prompts that block automation.

The file

We split this powershell.mdc into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    when using powershell to get the time, use this command first "powershell -Command …

    line 14
  2. Very specific:

    Use -UseBasicParsing to avoid DOM parsing issues

    line 65
  3. Distinctive:

    Always quote URLs with special characters

    line 66
  4. Very specific:

    Use curl.exe if you need actual curl behavior

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
powershell.mdc
---
description: 
globs: 
alwaysApply: true
---
# PowerShell Command Reference for Windows Development

## Powershell on Windows 10/11
- You are running powershell on windows 10/11, ensure that your commands and powershell usage is adjusted accordingly
- You have issues with using curl as its interpretted as a 'Invoke-Webrequest command and you will end up hung up on a prompt waiting for uri:
- && does not work as a command seperator well, you perform better when using ;

## Powershell Date Time
- when using powershell to get the time, use this command first "powershell -Command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')"


## Curl/HTTP Request Commands

**CRITICAL:** In PowerShell on Windows, `curl` is an alias for `Invoke-WebRequest` cmdlet, NOT the actual curl executable. This causes interactive prompts that block automation.

### ❌ AVOID - Gets stuck on Uri prompt:
```powershell
curl -s http://localhost:5000/api/status
# This will prompt: "Uri:" and hang
```

### ✅ USE INSTEAD:
```powershell
# Option 1: Use Invoke-WebRequest with proper syntax
Invoke-WebRequest -Uri "http://localhost:5000/api/status" -UseBasicParsing

# Option 2: Use shorthand 'iwr'
iwr "http://localhost:5000/api/status" -UseBasicParsing

# Option 3: Force actual curl executable
curl.exe -s http://localhost:5000/api/status

# Option 4: For JSON responses
(Invoke-WebRequest -Uri "http://localhost:5000/api/status").Content | ConvertFrom-Json
```

## Directory Navigation
```powershell
# Change directory and run command in one line
cd flask-vpn-manager; uv run python main.py

# Create multiple directories
New-Item -ItemType Directory -Path "app\templates", "app\static" -Force
```

## Powershell Flask Servers
- You often get hung when running a flask web server in chat... its better if you run it as a background task

## Flask Development
```powershell
# Start Flask in background
uv run python main.py &

# Test endpoints
Invoke-WebRequest -Uri "http://127.0.0.1:5000/" -UseBasicParsing
Invoke-WebRequest -Uri "http://127.0.0.1:5000/api/status" -UseBasicParsing
```

## Common Gotchas
- Use `-UseBasicParsing` to avoid DOM parsing issues
- Always quote URLs with special characters
- Use `curl.exe` if you need actual curl behavior
- PowerShell aliases can override expected behavior




Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.