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.
pub fn build(self) -> PsScript
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PsScriptBuilder
impl RefUnwindSafe for PsScriptBuilder
impl Send for PsScriptBuilder
impl Sync for PsScriptBuilder
impl Unpin for PsScriptBuilder
impl UnwindSafe for PsScriptBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more