$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 Register-ScheduledTask -Action $action -Trigger $trigger -TaskPath "MyTasks" -TaskName "git pull" -Description "git pull"