Expand description
§ps-parser
A fast and flexible PowerShell parser written in Rust.
§Overview
ps-parser
provides parsing, evaluation, and manipulation of PowerShell
scripts. It supports variables, arrays, hash tables, script blocks,
arithmetic, logical operations, and more.
§Features
- Parse PowerShell scripts using pest grammar
- Evaluate expressions, variables, arrays, hash tables, and script blocks
- Environment and INI variable loading
- Deobfuscation and error reporting
- Extensible for custom PowerShell types
§Usage
use ps_parser::PowerShellSession;
let mut session = PowerShellSession::new();
let output = session.safe_eval(r#"$a = 42; Write-Output $a"#).unwrap();
println!("{}", output); // prints: 42
Structs§
- Power
Shell Session - Represents a PowerShell parsing and evaluation session.
- Script
Result - Contains the complete result of parsing and evaluating a PowerShell script.
- Variables
- Manages PowerShell variables across different scopes.