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 supplied as text. |
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. | |
The text should be in an appropriate format for the target operating system. For example, a multi-line bash script should have lines separated by just linefeed (newline) characters, not Windows' carriage-return + linefeed. | |
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 function to convert to JSON; an example is provided here _Using PowerShell commands and scripts. | |
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. | |
In addition to the standard execution policy values, there is an additional special "
| |
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. | |
| |
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 | This generates an Output value of "Hello\nGoodbye " where \n is a newline character.Scripting.RunText(Language: "Bash", Text: "echo Hello; echo Goodbye"); AsUser example @users = Users.GetLoggedOnUsers(); @allExecutions = FOREACH @user IN @users DO @account = SELECT Account FROM @user; Scripting.RunText(Language: "Powershell", Text:"echo Hello; echo Goodbye", AsUser:@account); DONE; Passing a path as the Text It is possible to use this method to execute a pre-existing script file as the Text parameter exactly as if within a PowerShell prompt, for example: Scripting.RunText(Language:"PowerShell",Text:"C:\\ProgramData\\1E\\simpleEcho.ps1 $($args[0]) $($args[1])","hello","world"); Script arguments must be explicitly forwarded as shown, as only the author of the above line knows exactly where the parameters should go within the text field. However, the above is really what the Scripting.Run() method is designed for, which makes things far more readable. |
Platforms |
|
Notes | This is an alternative to the Scripting.Run method which instead uses a script in a file. 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 and scripts. 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. |