Python version information/RunPythonInstallers.ps1

From ihaveahax's Site
< Python version information
Revision as of 04:01, 27 October 2024 by Ihaveahax (talk | contribs) (Created page with "I made this so I could install multiple versions of Python at once, mainly in virtual machines. It expects each one to be in the same directory as the script. This isn't updated for 3.13 and the separate experimental "free-threading" build. <syntaxhighlight lang="powershell"> $UsedPath = Get-ChildItem -Path . -Name "UsedInstallers" if (!$UsedPath) { $UsedPath = New-Item -ItemType Directory -Name "UsedInstallers" } Write-Host $UsedPath Get-ChildItem -Filter 'python-*....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

I made this so I could install multiple versions of Python at once, mainly in virtual machines. It expects each one to be in the same directory as the script. This isn't updated for 3.13 and the separate experimental "free-threading" build.

$UsedPath = Get-ChildItem -Path . -Name "UsedInstallers"
if (!$UsedPath) {
    $UsedPath = New-Item -ItemType Directory -Name "UsedInstallers"
}
Write-Host $UsedPath
Get-ChildItem -Filter 'python-*.exe' | ForEach {
    #$Command = ".\$_ /passive InstallAllUsers=1 CompileAll=1 Include_doc=0 Include_debug=1 Include_symbols=1"
    #$Command = ".\$_ /?"
    #Write-Host $Command
    #Invoke-Expression "$Command"
    Start-Process -FilePath $_ -ArgumentList @('/passive', 'InstallAllUsers=1', 'CompileAll=1', 'Include_doc=0', 'Include_debug=1', 'Include_symbols=1') -Wait
    Move-Item -Path $_ -Destination $UsedPath
}