school-computer-toolkit/bootstrap.ps1

28 lines
641 B
PowerShell
Raw Normal View History

2022-06-09 14:05:55 -04:00
$run_path = Get-Location
2022-06-09 15:19:56 -04:00
$swtools = C:/SWTools
Push-Location $swtools
2022-06-09 14:05:55 -04:00
if (Get-Command "./python/python.exe" -ErrorAction SilentlyContinue) {
echo "Python already installed."
} else {
if (Get-Command "./python.zip" -ErrorAction SilentlyContinue) {
} else {
2022-06-09 14:31:22 -04:00
curl -Uri "https://www.python.org/ftp/python/3.10.5/python-3.10.5-embed-amd64.zip" -OutFile ./python.zip
2022-06-09 14:05:55 -04:00
}
2022-06-09 15:17:28 -04:00
if (Test-Path -Path "./python") {
2022-06-09 14:05:55 -04:00
Remove-Item -Recurse -ErrorAction:Stop "./python"
}
2022-06-09 15:12:25 -04:00
mkdir python
Push-Location python
tar -xf ../python.zip
2022-06-09 15:19:56 -04:00
Pop-Location
2022-06-09 14:05:55 -04:00
}
2022-06-09 15:19:56 -04:00
Pop-Location
$swtools/python/python.exe main.py $run_path