You can use Task Scheduler in Windows to run PowerShell scripts periodically, or outside of business hours.
Index
Save your script as a .ps1 file
To use Task Scheduler, you will need your script in a .ps1 file format.
You can use Windows PowerShel ISE to create scripts in that format.
If you use Notepad or another plain text editor to create your scripts, you can save them as a .txt format, and change the extension to .ps1 in Windows after.
Note: You have to import the the ShareGate migration tool module in your script for the scheduling to work.
Create a scheduled task
- Open Task Scheduler in Windows.
- Select Create Task... in the Actions panel to the right.
- Give the new task a name and description.
- Set your security settings.
Note: The user account you use must be the same user account that is licensed in the ShareGate migration tool. - Select the Triggers tab.
- Click New...
- Set the scheduling options.
Note: make sure Enabled is checked at the bottom. - Click OK.
- Select the Actions tab.
- Click New...
- Type Powershell.exe in the Program/script field.
- Type the file path of your script in the Add arguments field.
- Click OK.
- Review and modify the options in the Conditions and Settings tabs as needed.
- Click OK.