Contents
-
Writing Tachyon Instructions
-
Getting started with TIMS
-
Installing TIMS
-
Running instructions in Tachyon for the first time
-
Instruction Definition Reference
-
SCALE User Guide
-
Functions and Methods Reference
-
Tachyon Agent Methods
-
Agent.CheckForUpdates
-
Agent.Echo
-
Agent.GetConnectionInformation
-
Agent.GetDiagnostics
-
Agent.GetExtensibility
-
Agent.GetInstructionStatistics
-
Agent.GetKeyFiles
-
Agent.GetSummary
-
Agent.Log
-
Agent.Sleep
-
Agent.Stagger
-
ContentDistribution.Stage
-
ContentDistribution.StageAndExecute
-
Device.GetCriticality
-
Device.GetDisks
-
Device.GetInboundMappedDriveHistory
-
Device.GetInboundPrinters
-
Device.GetLocation
-
Device.GetOutboundMappedDriveHistory
-
Device.GetOutboundPrinters
-
Device.GetProcessors
-
Device.GetSummary
-
Device.SetCriticality
-
Device.SetLocation
-
Discovery.LookupNetBiosNames
-
Discovery.ScanPortsOnDevices
-
Discovery.SendArpRequest
-
FileContent.AppendText
-
FileContent.FindAndAppend
-
FileContent.FindAndDelete
-
FileContent.FindAndReplace
-
FileContent.GetTorrentAnnounceUris (deprecated)
-
FileContent.GetTorrentDescribedFiles (deprecated)
-
FileContent.GetTorrentInfo (deprecated)
-
FileContent.WriteText
-
FileSystem.CreateTempFile
-
FileSystem.DeleteFileByName
-
FileSystem.FindDirectoryByName
-
FileSystem.FindFileByName
-
FileSystem.FindFileBySizeAndHash
-
FileSystem.GetDigitalSignature
-
FileSystem.GetDirectoryHash
-
FileSystem.GetFile
-
FileSystem.GetFileByLine
-
FileSystem.GetFileDetails
-
FileSystem.GetFileHash
-
FileSystem.GetFilePermissions
-
FileSystem.GetFilesInDirectory
-
FileSystem.GetFilesInFolder (deprecated)
-
FileSystem.GetHash (deprecated)
-
FileSystem.GetVersionInfo
-
FileSystem.PathExists
-
Http.Post
-
Interaction.GetActiveResponses
-
Interaction.GetInteractionState
-
Interaction.GetResponseHistory
-
Interaction.GetSessions
-
Interaction.GetWindows
-
Interaction.InvalidateResponse
-
Interaction.SetDoNotDisturb
-
Interaction.ShowAnnouncement
-
Interaction.ShowNotification
-
Interaction.ShowQuestion
-
Interaction.ShowSurvey
-
Inventory.GetTables
-
Method Notes
-
Mobile.GetEmailAddress
-
Mobile.GetEncryptionStatus
-
Mobile.GetLocation
-
Mobile.GetMobileSummary
-
Mobile.GetPasswordQuality
-
Mobile.IsGPSEnabled
-
Mobile.IsPrintingSupported
-
NativeServices.GetWmiNames
-
NativeServices.RegistryDeleteKey
-
NativeServices.RegistryDeleteUserKey
-
NativeServices.RegistryDeleteUserValues
-
NativeServices.RegistryDeleteValue
-
NativeServices.RegistryEnumerateKeys
-
NativeServices.RegistryEnumerateUserKeys
-
NativeServices.RegistryEnumerateUserValues
-
NativeServices.RegistryEnumerateValues
-
NativeServices.RegistryGetUserValues
-
NativeServices.RegistryGetValue
-
NativeServices.RegistryKeyExists
-
NativeServices.RegistrySetUserValues
-
NativeServices.RegistrySetValue
-
NativeServices.RegistryUserKeyExists
-
NativeServices.RegistryUserValueExists
-
NativeServices.RegistryValueExists
-
NativeServices.RunCommand
-
NativeServices.RunWmiInstanceMethod
-
NativeServices.RunWmiQuery
-
NativeServices.RunWmiStaticMethod
-
Network.GetArpEntries
-
Network.GetConnections
-
Network.GetDnsEntriesByAddress
-
Network.GetIpAddress (deprecated)
-
Network.GetIpAddresses
-
Network.GetListeningEndpoints
-
Network.GetNetworkSummary
-
Network.GetWiFiNetworks
-
Network.SetAirplaneMode
-
Network.SetBlueToothMode
-
Network.SetWiFiMode
-
Nomad.CachedPkgStatus
-
Nomad.FindBestPkgCache
-
Nomad.GetCachedPkgDetails
-
Nomad.GetCmContentLocations
-
Nomad.GetVariable
-
Nomad.JobsStatus
-
Nomad.Pause
-
Nomad.PauseJobQueue
-
Nomad.Resume
-
Nomad.ResumeJobQueue
-
Nomad.RunPkgStatusRequest
-
Nomad.RunSsdQuery
-
Nomad.Status
-
Nomad.Stop
-
OperatingSystem.ControlService
-
OperatingSystem.GetInstalledUpdates
-
OperatingSystem.GetProcesses
-
OperatingSystem.GetRunningApps
-
OperatingSystem.GetServiceInfo
-
OperatingSystem.GetSummary
-
OperatingSystem.GetUpdatesPendingReboot
-
OperatingSystem.GetUpdateSummary
-
OperatingSystem.KillProcess
-
OperatingSystem.KillProcesses
-
Patch.Deploy
-
Patch.GetStatus
-
Patch.List
-
Patch.TestConnection
-
Policy.ForceStatusReport
-
Policy.GetEventSubscriptions
-
Policy.GetRuleEvaluationHistory
-
Policy.GetRules
-
Policy.GetStatistics
-
Policy.GetSummary
-
Policy.Invalidate
-
Scripting.Run
-
Scripting.RunText
-
Security.CheckSimpleIoc (deprecated)
-
Security.DeleteCertificates
-
Security.GetCertificates
-
Security.GetQuarantineStatus
-
Security.ModifyQuarantineWhitelist
-
Security.QuarantineDevice
-
Security.UnquarantineDevice
-
Software.GetInstallations
-
Software.GetUserInstallations
-
Software.Uninstall
-
Storage.Check
-
Storage.Delete
-
Storage.Get
-
Storage.GetRemote
-
Storage.List
-
Storage.Set
-
Tagging.Check
-
Tagging.Clear
-
Tagging.Count
-
Tagging.Delete
-
Tagging.Get
-
Tagging.GetAll
-
Tagging.Set
-
Users.FindLocalGroupMember
-
Users.GetInboundConnectionHistory
-
Users.GetLocalGroupMembers
-
Users.GetLoggedOnUsers
-
Users.GetOutboundConnectionHistory
-
Users.GetPrimaryUser
-
Utilities.GenerateSequence
-
Utilities.JsonFromTable
-
Utilities.SplitLines
-
Utilities.TableFromJson
-
Agent.CheckForUpdates
-
Tachyon Agent Built-in Functions
-
Tachyon Agent Built-in Keywords
-
Tachyon Agent SQL Functions
-
Tachyon Agent Methods
-
Custom Response Visualizations
-
Training Lab Guide - Advanced
-
Getting started with TIMS
-
Integrating with Tachyon
-
Tachyon .NET Consumer SDK
-
Tachyon PowerShell Toolkit
-
Index
Method | Run |
---|---|
Module | Scripting |
Library | Scripting |
Action | Execute the specified script file. |
Parameters |
|
LanguageVersion (string; optional): If specified, the version of the script interpreter, e.g. "3.0" for PowerShell if features not supported in older versions are used. A runtime error occurs if the requested version of the interpreter is not available on the host. | |
While the earlier " The script file must be in a format suitable for the target O/S. For example, the line-end character for a bash script must be just newline, not Windows-style carriage-return + newline. Recommended to be local. Use the httpGetFile() function to download a file. The output of the function is FilePath. | |
If InterpretAsJson is set to true, then the output of the script must be serialized as JSON. PowerShell 3.0 and later has a ConvertTo-Json cmdlet. If using PowerShell 2.0 then LanguageVersion must be set to 2.0 and your script will need to include a custom function to convert to JSON. | |
Timeout is not supported on Android. It is not an error to specify the parameter but the value will be ignored. | |
Try to avoid using TimeoutKill if possible, and instead let the sub-process die in its own time. For example, consider the effect of killing an install partway through. Also, only the script interpreter is killed, not any sub-sub-processes it may invoke. | |
| |
IgnoreExitCode only applies if the script actually executes and terminates. This is not a general "keep going regardless of anything failing" switch. For example, if an attempt is made to run a PowerShell script but powershell.exe itself is broken, then execution of the method fails regardless of the IgnoreExitCode setting. | |
WorkingDirectory (string, optional): This will set the working directory for the script execution to the specified path. If the path does not exist, the agent will return an error. This is not supported on Android. | |
If this parameter is absent the command will be executed in the Tachyon Agent process's user context. It is not an error if the specified user is not currently logged on (and this includes accounts that are not even defined). In this case execution is deemed successful but the method does nothing and returns no data. The specified user must be currently logged on and running explorer.exe (Windows Explorer). | |
script_params ... (optional): Zero or more "anonymous" parameters (i.e. just values, with no " | |
Return values | If parameter Otherwise:
Depending on the script, an exit code of 0 does not necessarily mean that execution was successful.
|
Example | The first PowerShell example runs a script that itself takes 2 positional parameters with values " This also shows that usually a call to the @resource1 = HttpGetFile(URL:"myscript.ps1", Size:483, Hash:"ff3f4bd8fb4e0e0ae0caeef8eb03cbc6dbf4d61b005bb5f43427710286811803"); Scripting.Run(Language: "PowerShell", LanguageVersion: "3.0", ScriptPath: @resource1, TimeoutSecs: 5, ExecutionPolicy: "Override", "script param 1", 42); This next PowerShell example runs the script as each of the logged-on users (if any): AsUser example @script = HttpGetFile(URL:"myscript.ps1", Size:483, Hash:"ff3f4bd8fb4e0e0ae0caeef8eb03cbc6dbf4d61b005bb5f43427710286811803"); @users = Users.GetLoggedOnUsers(); @allExecutions = FOREACH @user IN @users DO @account = SELECT Account FROM @user; Scripting.Run(Language: "PowerShell", LanguageVersion:"3.0", ScriptPath:@script, TimeoutSecs:5, AsUser:@account, "script param 1", 42); DONE; This Bash example is rather artificial but shows the creation of a temporary bash script then execution of the script to produce " NativeServices.RunCommand(CommandLine: "/bin/bash -c 'echo echo Hello > /tmp/temp'"); Scripting.Run(Language:"Bash", ScriptPath:"/tmp/temp"); |
Platforms |
|
Notes | 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 " 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. 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. |