vat-software/scripts/shared_sw/task_setup.ps1
2023-05-19 13:59:14 +02:00

25 lines
678 B
PowerShell

$path = [Environment]::GetFolderPath("MyDocuments")
$path2 = "VAT-Software"
cd $path
if (Test-Path -LiteralPath (Join-Path $path $path2)) {
Remove-Item 'VAT-Software' -Recurse -Force -Confirm:$false
}
git clone https://git.iop.cz/vat/software.git VAT-Software
cd VAT-Software
git config credential.helper store
git config user.email "vat_emp@dalkove-ovladace.cz"
git config user.name "vat_emp"
$path = $path + "\VAT-Software" + "\cron.bat"
$action = New-ScheduledTaskAction -Execute $path
$trigger = New-ScheduledTaskTrigger -Daily -At 10am
$fullPath = Join-Path $path $path2
schtasks /create /sc minute /mo 120 /tn "Git pull" /tr "PowerShell $fullPath'\cron.ps1'"