PowerShell .ps1 scripts with Cerewro: create, run and schedule
Cerewro can write complete .ps1 scripts from a description, configure the required ExecutionPolicy, execute them and schedule them as automatic tasks with schtasks.
Create and run PS1 script
Create a PowerShell script that backs up C:\data to D:\backup with timestamp and runs it now
Script generated by Cerewro
$date = Get-Date -Format "yyyyMMdd_HHmmss"
$dest = "D:\backup\data_$date"
New-Item -ItemType Directory -Path $dest -Force
robocopy C:\data $dest /MIR /R:3 /W:5
Write-Host "Backup completed at: $dest"
Schedule script as daily task
schtasks /create /tn "DailyBackup" /tr "powershell -File C:\scripts\backup.ps1" /sc daily /st 02:00