Class TerminalUtility
java.lang.Object
io.github.eggy03.ferrumx.windows.utility.TerminalUtility
A utility class that provides an alternative way to launch a PowerShell session without
jPowerShell
Mostly for internal use
- Since:
- 3.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringexecuteCommand(@NonNull String command, long timeoutSeconds) Launches a standalone PowerShell session and executes commands and returns the result
-
Constructor Details
-
TerminalUtility
public TerminalUtility()
-
-
Method Details
-
executeCommand
@NotNull public static @NotNull String executeCommand(@NonNull @NonNull String command, long timeoutSeconds) Launches a standalone PowerShell session and executes commands and returns the result- Parameters:
command- The command to be executed in the PowerShelltimeoutSeconds- Time in seconds after which the session will be force stopped- Returns:
- The result of the command executed
- Throws:
TerminalExecutionException- When the process is killed pre-maturely upon reaching the timeout or when the command yields an errorIllegalArgumentException- If the provided timeout is in the negative
-