834 - ESE backup script example: running PowerShell scripts

Modified on Mon, 21 Jul at 12:55 PM

 

An example of encapsulating PowerShell scripts in batch files for use by the ESE Agent is provided below.

 

1. Create your PowerShell script.

For example, this script named "PowerShellTest.ps1" moves all files from C:\Folder1 to C:\Folder2.
Move-Item -Path C:\Folder1\* -Destination C:\Folder2

2. Create a batch file.

It should contain the following:
powershell.exe -executionpolicy Bypass -file <path to powershell file>

 

Example:
powershell.exe -executionpolicy Bypass -file .\PowerShellTest.ps1

Note: The path to the PowerShell file can be absolute or relative.

3. Save the batch file.

4. Configure the Script in the Agent.

Add the script to the Backup Scripts configuration in ESE (under Tools > Options and Settings), setting it to run before the backup or afterwards as desired.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article