(parsed: ParsedPowerShellCommand)
| 1465 | */ |
| 1466 | // exported for testing |
| 1467 | export function getAllCommandNames(parsed: ParsedPowerShellCommand): string[] { |
| 1468 | const names: string[] = [] |
| 1469 | for (const statement of parsed.statements) { |
| 1470 | for (const cmd of statement.commands) { |
| 1471 | names.push(cmd.name.toLowerCase()) |
| 1472 | } |
| 1473 | if (statement.nestedCommands) { |
| 1474 | for (const cmd of statement.nestedCommands) { |
| 1475 | names.push(cmd.name.toLowerCase()) |
| 1476 | } |
| 1477 | } |
| 1478 | } |
| 1479 | return names |
| 1480 | } |
| 1481 | |
| 1482 | /** |
| 1483 | * Get all pipeline segments as flat list of commands. |
no outgoing calls
no test coverage detected