shell_exec_verified
Executes PowerShell commands, then independently verifies outcomes with filesystem assertions such as path existence, directory or file type, or file contents; retries with exponential backoff on failure.
Instructions
执行命令,并用文件系统 API 独立验证结果;验证不过自动带指数退避重试(自愈雏形)。 不轻信命令自身的返回值:例如 mkdir 之后,真的去确认目录存在。 expect 支持:pathExists / pathNotExists / isDir / isFile / fileContains:[路径,内容] / cwd
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expect | Yes | 验证断言,如 {"isDir":"D:\\tmp\\x"} 或 {"fileContains":["D:\\a.txt","hello"]} | |
| command | Yes | 要执行的 PowerShell 命令 | |
| retries | No | 失败重试次数,默认 2 | |
| timeout | No | 单次超时毫秒,默认 30000 |