Xopero users can create their own scripts, that can be used during the backup process. Each script consists two files::
- PS1 - a PowerShell script,
- XML - backup set configuration file.
Both files for each script should be copied into Script folder in Xopero installation location, for example: C:\Program Files(x86)\Xopero\Script.
A PowerShell script should have a PS1 extension and it can be launched before the backup is created (PRE script) or after the backup is finished (POST script). Pre scripts are mostly used to prepare data for being backed up. Post scripts can be then used to delete temporary files that were created by pre script for the time of backup.
To use a PowerShell script in Xopero, each PS1 file needs corresponding XML, where all the script information is stored, such as name of the script shown in application, its location and other parameters required to run the script.
The XML file's content has to be restricted in <script> tag, which has two parameters:
- name - the name of the script which will be displayed in application,
- file - path to the PowerShell script.
Each of user's parameter have to be written as a <param /> tag with parameters:
- name - name of the parameter, the same name preceded with $ tag is used in the PowerShell script,
- description - name of the parameter displayed in the application,
- help - description of the parameter, that is displayed in the application when you click that parameter,
- value - default value of the parameter.
Some sample pre and post scripts can be found using below attachments: