Struct powershell_script::PsScriptBuilder
source · pub struct PsScriptBuilder { /* private fields */ }
Expand description
Builds a PsScript
instance with configurable options for running your
script.
Implementations§
source§impl PsScriptBuilder
impl PsScriptBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a default builder with no_profile, non_interactive and hidden options set to true and print_commands set to false.
sourcepub fn no_profile(self, flag: bool) -> Self
pub fn no_profile(self, flag: bool) -> Self
Prevents environment specifc scripts from being loaded. See NoProfile parameter
sourcepub fn non_interactive(self, flag: bool) -> Self
pub fn non_interactive(self, flag: bool) -> Self
Runs the script in non-interactive mode, which does not present an interactive prompt to the user. See NonInteractive flag
Prevents PowerShell window from being shown by creating a console window with the CREATE_NO_WINDOW flag set. See creation flags
Note
On any other platform than Windows this is currently a no-op.
sourcepub fn print_commands(self, flag: bool) -> Self
pub fn print_commands(self, flag: bool) -> Self
If set to true
it will print each command to stdout
as they’re run.
This can be particularely useful when debugging.