Код: Выделить всё
$url = "https://www.python.org/ftp/python/3.9.10/python-3.9.10.exe"
$pythonPath = "C:/Program Files/python/python-3.9.10.exe"
If ((Test-Path C:) -and !(Test-Path "C:\Program Files\python"))
{
New-Item -Path "C:\Program Files\" -Name "python" -ItemType "directory"
}
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
Invoke-WebRequest -Uri $url -OutFile $pythonPath
Подробнее здесь: https://stackoverflow.com/questions/735 ... ell-script
Мобильная версия