powershell_script 1.1.0

A library for running Windows PowerShell scripts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
extern crate powershell_script;

#[cfg(windows)]
const LINE_ENDING: &'static str = "\r\n";
#[cfg(not(windows))]
const LINE_ENDING: &'static str = "\n";

#[test]
fn main() {
    let script = r#"echo "hello world""#;
    let output = powershell_script::run(script).unwrap();
    assert_eq!(output.stdout().unwrap(), format!("hello world{}", LINE_ENDING));
}