2026-03-30 10:15:58 +00:00
import { createShellTool } from "./util"
2026-03-30 10:08:27 +00:00
2026-03-30 10:18:50 +00:00
export const PowershellTool = createShellTool ( {
id : "powershell" ,
2026-03-30 10:42:42 +00:00
shellName : "Windows PowerShell" ,
toolName : "PowerShell" ,
listCmd : "Get-ChildItem" ,
gitCmds : "git commands" ,
2026-03-30 10:18:50 +00:00
chaining :
2026-03-30 10:42:42 +00:00
"use PowerShell conditionals such as `cmd1; if ($?) { cmd2 }` when later commands must depend on earlier success." ,
2026-03-30 10:18:50 +00:00
guidance : ` # Windows PowerShell 5.1 shell notes
2026-03-30 10:42:42 +00:00
- Use \ ` cmd1; if ( $ ?) { cmd2 } \` to chain dependent commands.
2026-03-30 10:18:50 +00:00
- Use double quotes for interpolated strings ( \ ` "Hello $ name" \` ), single quotes for verbatim strings.
2026-03-30 10:42:42 +00:00
- Cmdlets use Verb - Noun naming ( e . g . , \ ` Get-ChildItem \` , \` Set-Content \` ). Common aliases like \` ls \` , \` cat \` , \` rm \` execute the equivalent PowerShell cmdlets.
2026-03-30 10:18:50 +00:00
- Use \ ` $ (...) \` for subexpressions. Use \` @(...) \` for array expressions.
- To call a native executable whose path contains spaces , use the call operator : \ ` & "path/to/exe" args \` .
2026-03-30 10:42:42 +00:00
- Escape special characters with backtick ( \ \ \ ` ). ` ,
2026-03-30 10:18:50 +00:00
} )