|script_params ... (optional): Zero or more "anonymous" parameters (i.e. just values, with no "|
script_params ... (optional): Zero or more "anonymous" parameters (i.e. just values, with no "
These examples use the newer
Run The first PowerShell example runs a PowerShell script that itself takes 2 positional parameters with values "
This also shows that usually a call to the
This nextexample is rather artificial but shows the creation of a temporary bash script then execution of the script to produce "
This PowerShell example runs the script as each of the logged-on users (if any):
This Bash example is rather artificial but shows the creation of a temporary bash script then execution of the script to produce "
This is an alternative to the Scripting.RunText method which instead uses script text supplied as a parameter.
Because the Tachyon Agent has multiple workers and so can run a number of instructions in parallel, it is possible that conflicting scripts could run at the same time, e.g. each attempting to install software. (Software packages can only usually be installed one at a time.) If this is likely to be a problem, the Agent's "
For more guidance using PowerShell on Windows see _Using PowerShell Commands commands and Scriptsscripts.
This method does not have a SplitLines parameter. If the script output is a single text block and not JSON, then you can use the Utilities.SplitLines method to split the text block into lines.
From v3.1 PowerShell script parameters are in effect surrounded by single quotes when the script is executed. This is to allow parameter values to contain embedded spaces, and to allow what can be metacharacters (e.g. '
If the Agent is shut down while a script is running (with or without a timeout specified), the script subprocess is detached from the Agent (so that Agent shutdown is not blocked), and the Tachyon instruction's status is set to "execution failed" because Tachyon cannot know the ultimate fate of the script. It is up to the user to decide whether to resubmit the instruction or not when the Tachyon Agent resumes.
By default, a long-running instruction will time out. "Long running" is 3600 seconds, i.e. 1 hour. This is to prevent a hanging script from completely blocking the Tachyon Agent, because the Agent has an exclusivity feature for safety such that even if the Agent runs with multiple workers then executing a script prevents any other worker from running an instruction in parallel. (This is because instructions that follow the script's execution might depend on that script having run to completion.) A script hanging indefinitely would completely block the Agent, including any instructions to kill the hanging script's process. If a script really must be run to completion, set
For Android, although the method is supported, the Android sandbox environment is usually so restrictive that scripts cannot successfully run many commands, especially commands that access the filesystem.