$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 15 /tn "Git pull" /tr "PowerShell $fullPath'\cron.ps1'"