File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ edition = "2021"
66# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77
88[dependencies ]
9- rand = " 0.8"
9+ powershell_script = " 1.1.0"
10+ rand = " 0.8"
Original file line number Diff line number Diff line change 1+ use powershell_script:: PsScriptBuilder ;
12use rand:: seq:: SliceRandom ;
23use std:: collections:: HashMap ;
34use std:: env;
@@ -530,6 +531,17 @@ impl Executor {
530531 }
531532 }
532533
534+ "shell" => {
535+ let ps = PsScriptBuilder :: new ( )
536+ . no_profile ( true )
537+ . non_interactive ( true )
538+ . hidden ( false )
539+ . print_commands ( false )
540+ . build ( ) ;
541+ let output = ps. run ( self . pop_stack ( ) . get_string ( ) . as_str ( ) ) . unwrap ( ) ;
542+ self . stack . push ( Type :: String ( output. stdout ( ) . unwrap ( ) ) ) ;
543+ }
544+
533545 // プロセスを終了
534546 "exit" => {
535547 let status = self . pop_stack ( ) . get_number ( ) ;
You can’t perform that action at this time.
0 commit comments