ScriptExecute
Use this command to trigger the script listed in the
Scripts
editor.Syntax
ScriptExecute <file>
[/S
] [/P
parameters
]where
<file>
is the reference to a script file. It's only supported for script files with the .ps1 extension.[
/S
] is to define that the triggered commands execute synchronously. This parameter must directly follow the script file name.- Synchronousmeans that all scripts run on a shared thread. They execute in the order that they are triggered. If too many scripts are called all at once, it will take long periods of time to execute.
- Asynchronousmeans that all scripts run on its own thread. This is useful when a script takes a long time to execute, so that it does not hinder the execution of other scripts.
[
/P
parameters
] is to specify the parameters needed to execute the script.
TIP:
/K
parameter can be used to end running scripts.- UseScriptExecute * /Kto end running scripts and remove all scripts from the task list.
- UseScriptExecute <file> /Kto end specific running script and remove all scripts of the same name from the task list.
For each executing script, a log is generated under C:\Users\Public\Public Documents\RSView Enterprise\SE\Scripts\ScriptLogs\
ApplicationType
\ApplicationName
, where ApplicationType
is Global or Local depending on your application type, and ApplicationName
is your application name. Use the log for troubleshooting purposes if needed.Remarks
To specify the time of script execution before it's automatically terminated, configure the Script Execution Timeout property in
System > Policies > Product Policies > FactoryTalk View SE > Script Settings
.In the script file, don't define interactive script that needs user input or other action. FactoryTalk View does not provide an interactive interface for such scripts.
If a script contains mandatory parameters, make sure to specify the mandatory parameters needed to execute the script.
When using special characters, see Microsoft website for PowerShell parsing rules on special characters. You may use single quotation marks (' ') or double quotation marks (" ") to enclose strings with special characters.
Space acts as a separator in PowerShell parameters. Pay attention to it when it is included in tag value.
For example,
ScriptExecute "RecordTagvalue" /P'Tag value is $Tag1$'
.
IMPORTANT:
Prior to running any script imported from other places, please verify and ensure the script contents are safe and trusted.
Provide Feedback