title: Creating a Script for the VM
created at: Fri Jul 19 2024 17:20:25 GMT+0000 (Coordinated Universal Time)
updated at: Mon Feb 10 2025 16:44:57 GMT+0000 (Coordinated Universal Time)
---
# Creating a Script for the VM
Scripts allow you to set up virtual machines automatically: install software applications, modify configuration files, and perform other operations. Scripts from the ISPsystem repository are available per default.
On a Linux OS, you can run Shell scripts written in *bash*, and on a Windows OS, you can run Powershell scripts.
You can set parameters for the script. Their values will need to be entered or selected from the list when running the script. [Variables](https://docs.ispsystem.com/v6/scripts/variables-for-scripts) can be used as parameters to be entered manually. Then, when the script is run, the value of the variable will be displayed in the parameter input field.
!! Note
!! The value of the built-in PASS variable, which contains the root password, cannot be changed when running the script. Use your own variable or parameter to pass the password to the script.
# Creating a script

To create a script:
1. Go to **Scripts → Create a script**.
2. Enter a script **Name**.
3. Specify a **Description**. It is displayed in the script list.
4. Specify \*\*Filters \*\*to run the script. The script is available to run on a VM if the conditions of all filters match. The **OS tags** filter is mandatory, the others are optional.
5. If necessary, specify the requested script parameters:
1. Press **Add parameter**.
2. Specify the parameter **Name** and **Description**. If you use a variable name as a parameter, its description will be added automatically.
3. You can specify parameter values that will be offered when the script is run. To do this, click **Add**:
```
- Specify **Parameter value** and **Describe value.**
- To add more parameters, press **Add one more value. **In the right part of the window, you can see what the parameter selection form will look like.
![Example of the form
```
]\(https://slite.com/api/files/Z4fvYFOaBKvLST/example-of-the-form.png?apiToken=eyJhbGciOiJIUzI1NiIsImtpZCI6IjIwMjMtMDUtMDQifQ.eyJzY29wZSI6Im5vdGUtZXhwb3J0IiwibmlkIjoiZkxoa3BTcS12ZDJOUloiLCJpYXQiOjE3MjgwODc4NjIsImlzcyI6Imh0dHBzOi8vc2xpdGUuY29tIiwianRpIjoiS2hqdnRUczR0UHdWZ2QiLCJleHAiOjE3MzA2Nzk4NjJ9.qTBZE56uJXJDODuwkYzuPUsGrWQXRYyj7\_iA5OgYcLE)
```
- Press **Add**.
1. For a mandatory parameter, enable the **Required** option.
1. To add more parameters to the script, press **Add one more parameter to script**.
```
6. Select a **Script type:**
* **Shell script** — for Linux OS;
* **Powershell script** — for Windows OS.
7. Enter the **Script** in the editor window. To expand the editor window to the full screen, press

1. . To return to the window mode, press

1. . The editor has an auto-complete feature. For example, if you need to insert in a script the name of an [external variable](/Help%20Center/Help%20Center/VPS%20Hosting/Scripts/Variables%20for%20Scripts.md) , start typing and the editor will suggest endings.
2. To send an email to the user after running the script, press **Add** in the \*\*Notification to email \*\*section.
3. By default, you are offered to set up an English email template — **Email for EN**.
4. Enter the **Email subject**.
5. Next, specify the content of the email in the **Content** field. In this field, you can use the same variables and parameters that you used in the script. Read more about creating email templates in [Email templates in scripts](/Help%20Center/Help%20Center/VPS%20Hosting/Scripts/Email%20Templates%20in%20Scripts.md) .
6. Click **Preview** to preview the email.
7. If you need an email template in Russian, press **Add the email for RU**. If you no longer need any of the templates, press **Delete the email for RU / Delete the email for EN**.
8. Click on **Create**.
# Operations with scripts

To change script settings, go to **Scripts** → select script →

menu → **Edit**.
To run the script on a VM, enter **Virtual machines** → select the VM →

menu → **Run script** → select the script → enter the script parameters → **Run** .
To interrupt the execution of the script, press

in the VM card or the task queue.