( parsed: ParsedPowerShellCommand, )
| 1486 | * Useful for checking each command independently. |
| 1487 | */ |
| 1488 | export function getAllCommands( |
| 1489 | parsed: ParsedPowerShellCommand, |
| 1490 | ): ParsedCommandElement[] { |
| 1491 | const commands: ParsedCommandElement[] = [] |
| 1492 | for (const statement of parsed.statements) { |
| 1493 | for (const cmd of statement.commands) { |
| 1494 | commands.push(cmd) |
| 1495 | } |
| 1496 | if (statement.nestedCommands) { |
| 1497 | for (const cmd of statement.nestedCommands) { |
| 1498 | commands.push(cmd) |
| 1499 | } |
| 1500 | } |
| 1501 | } |
| 1502 | return commands |
| 1503 | } |
| 1504 | |
| 1505 | /** |
| 1506 | * Get all redirections across all statements. |
no outgoing calls
no test coverage detected