school-computer-toolkit/bootstrap.ps1

28 lines
641 B
PowerShell

$run_path = Get-Location
$swtools = C:/SWTools
Push-Location $swtools
if (Get-Command "./python/python.exe" -ErrorAction SilentlyContinue) {
echo "Python already installed."
} else {
if (Get-Command "./python.zip" -ErrorAction SilentlyContinue) {
} else {
curl -Uri "https://www.python.org/ftp/python/3.10.5/python-3.10.5-embed-amd64.zip" -OutFile ./python.zip
}
if (Test-Path -Path "./python") {
Remove-Item -Recurse -ErrorAction:Stop "./python"
}
mkdir python
Push-Location python
tar -xf ../python.zip
Pop-Location
}
Pop-Location
$swtools/python/python.exe main.py $run_path