You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using your crate to package a powershell script that installs my ReaClassical system. As you can see, the original ps1 script includes various Write-Host messages that are helpful to show progress. I wonder if that is possible with your crate somehow? Or is it a case of needing to separate the ps1 file into smaller chunks and use Rust's println!?
I tried setting .print_commands flag to true but it seems to just dump the contents of the script all at once versus actual output.
The text was updated successfully, but these errors were encountered:
My workaround for now is a println! statement followed by passing chunks of the original ps1 via &str to a modified call_script function like so: call_script(include_str!("1_7zip.ps1"));. It works but the only pain is that dot sourcing obviously doesn't work for a variables.ps1 to maintain the required variables in one place. Chunking the script means that any variables in memory are wiped before the next iteration.
Maybe I'm best sticking with the powershell ps2exe module?
I think that if you fork the crate and call one of the non-blocking versions that kicks off the child process, and then pipe the output of the child process to stdout on the main process you could be able to achieve what you want, but I haven't tried that before. If you figure out a way to do that, please let me know and I could maybe create a non-blocking version of PsScript::run which allows users to monitor the state and progress of the child process.
I am using your crate to package a powershell script that installs my ReaClassical system. As you can see, the original ps1 script includes various Write-Host messages that are helpful to show progress. I wonder if that is possible with your crate somehow? Or is it a case of needing to separate the ps1 file into smaller chunks and use Rust's
println!
?I tried setting .print_commands flag to true but it seems to just dump the contents of the script all at once versus actual output.
The text was updated successfully, but these errors were encountered: