You can create and edit scripts on the Atera platform. Once created, the script is stored in your scripts repository and can be run immediately. One useful feature is the ability to add script variables, whose value can be changed as needed.
This article explains how to add and edit scripts with variables and define their values.
Add a variable when creating a script
1. Click on Admin (in the side menu).
2. Then click on Scripts.
The Scripts page appears.
3. Click the Create Script button, at the top, right of the page.
The Create Script screen appears.
4. a) Fill in the required fields.
b) Add your script to the Script Editor. You can add a variable to your script by typing the variable in the following format: {[variable_name]}. Don't use any spaces or special characters such as !@#$%^&*. If you do, you'll receive an error as in the example below.
5. Click Create to create the script.
The script now appears in your scripts repository.
Once you've created your script, you can define the value of the variable when you run the script.
To run the script and define the variable's value
1. From the Devices page, locate the device on which you'd like to run the script.
2. Click the Manage drop-down menu, and select Run Script.
The Run Script screen appears.
3. Select the script you wish to run, and click Run.
If the selected script has a variable, a screen appears requesting that you specify a value.
4. Type a value in the field, and click Run Script.
The script runs using the variable value you added. You can also edit an existing script, including the variables.
To edit a script and the variables
1. Click on Admin (in the side menu).
2. Then click on Scripts.
The Scripts page appears.
3. Locate the script you wish to edit, and click on it. The Edit Script page appears.
4. Click the Edit Script button (at the bottom, right of the page). You can now edit the script in the Scripts Editor (including adding, changing or removing variables).
5. When finished making changes to the script, click Save (at the bottom, right of the page). Your changes are saved.