This commit is contained in:
freddydk 2023-06-29 08:38:34 +02:00
Родитель c59fccdffa
Коммит d2af75a66a
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -6,7 +6,6 @@
}
#Install Choco
AddToSTatus "Install Choco"
$ENV:chocolateyVersion = "1.4.0"
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation

Просмотреть файл

@ -385,6 +385,18 @@ if ($organization -ne "" -and $token -ne "" -and $pool -ne "" -and $agentUrl -ne
}
}
try {
$version = [System.Version](Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' -Name 'Version')
if ($version -lt '4.8.0') {
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -UseBasicParsing -uri 'https://go.microsoft.com/fwlink/?linkid=2088631' -OutFile 'C:\DEMO\dotnet48.exe'
& 'C:\DEMO\dotnet48.exe' /q /norestart
}
}
catch {
throw ".NET Framework 4.7 or higher doesn't seem to be installed"
}
$startupAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -WindowStyle Hidden -ExecutionPolicy UnRestricted -File $setupStartScript"
$startupTrigger = New-ScheduledTaskTrigger -AtStartup
$startupTrigger.Delay = "PT1M"