Skip to content

Commit 1496505

Browse files
committed
Add PowerShell command generation rules
- Create new markdown file for PowerShell console command guidelines - Define syntax and best practices for PowerShell 7 commands - Provide comprehensive reference for Windows 11 PowerShell usage - Highlight key differences from bash and cmd.exe syntax
1 parent 724035b commit 1496505

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: PowerShell 7 Command Generation (Not Bash)
3+
globs: ["*.ps1", "*.psm1", "*.psd1", "*.md", "*.txt"]
4+
alwaysApply: true
5+
---
6+
7+
When generating console commands, use PowerShell 7 syntax for Windows 11, NOT bash syntax. Remember these key differences:
8+
9+
- Use PowerShell cmdlets like Get-ChildItem (not ls), Set-Location (not cd), etc.
10+
- Use backslashes for paths (C:\Users\) not forward slashes
11+
- Command flags use hyphen prefix (-Force) not double-hyphen (--force)
12+
- Variables use $ prefix ($variable) and string interpolation uses "$()"
13+
- Environment variables use $env:VARIABLE format
14+
- Piping uses | operator but cmdlets expect specific object input
15+
- Command concatenation uses ; or separate lines, not &&
16+
- Redirection uses >, >>, 2> (not 2>&1)
17+
18+
Always prefer PowerShell-native approaches over legacy cmd.exe commands.

0 commit comments

Comments
 (0)