$tmpPath = Join-Path $env:LOCALAPPDATA "Temp" function DownloadFiles { param ( [string] $Type ) switch ($Type) { "Labo" { $filesToDownload = @( @{ Url = "https://education.lego.com/_/downloads/EV3_Classroom_Windows_1.5.3_Global.msi" FileName = "EV3_Classroom_Windows_1.5.3_Global.msi" }, @{ Url = "https://cdn.discordapp.com/attachments/704760633379389533/1161288505390026772/simulation.zip" FileName = "simulation.zip" }, @{ Url = "https://cdn.discordapp.com/attachments/704760633379389533/1161288504765059172/RobotProg.zip" FileName = "RobotProg.zip" }, @{ Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" FileName = "O365ProPlusRetail.img" } ) } "Info" { $filesToDownload = @( @{ Url = "https://winstars.net/files/version3/winstars_installer.exe" FileName = "winstars_installer.exe" }, @{ Url = "https://cosphilog.fr/tectoglob3d/Tectoglob3D-win32-ia32.zip" FileName = "Tectoglob3D-win32-ia32.zip" }, @{ Url = "https://web.archive.org/web/20161115042325/http://extranet.saintjosephtoulouse.org/labo/Files/64_sismolog.sfx.exe" FileName = "Sismolog.exe" }, @{ Url = "http://acces.ens-lyon.fr/acces/logiciels/applications/tectoglob/Tectoglob_11_complet.zip/at_download/file" FileName = "Tectoglob_11_complet.zip" }, @{ Url = "http://svt.janzac.free.fr/logiciels/respipoisson/respipoisson.exe" FileName = "Respipoisson.exe" }, @{ Url = "https://regressi.fr/wp-zip/regressi-mpeg-setup.msi" FileName = "regressi-mpeg-setup.msi" }, @{ Url = "http://labocharlemagne.free.fr/logiciels/regavi.zip" FileName = "regavi.zip" }, @{ Url = "https://cdn.discordapp.com/attachments/704760633379389533/1163787807723094037/Radiochr_08.exe" FileName = "Radiochr.exe" }, @{ Url = "http://acces.ens-lyon.fr/acces/thematiques/evolution/logiciels/phylogene/telechargement-eleves/Phylogene-Lycee-2021.zip" FileName = "Phylogene-Lycee-2021.zip" }, @{ Url = "http://philippe.cosentino.free.fr/productions/paleoterre/paleoterre_el32.zip" FileName = "paleoterre_el32.zip" }, @{ Url = "http://acces.ens-lyon.fr/logiciels/EduAnat2/Eduanat2%20Setup%202.0.0.exe" FileName = "Eduanat2_Setup_2.0.0.exe" }, @{ Url = "https://www.pedagogie.ac-nice.fr//svt/productions/flash/couvac/couvac_exe.zip" FileName = "couvac_exe.zip" }, @{ Url = "https://acdusdownload.s3.amazonaws.com/ACDLabs202311_ChemSketch_FInstall.zip" FileName = "ACDLabs202311_ChemSketch_FInstall.zip" }, @{ Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" FileName = "O365ProPlusRetail.img" } ) } "Laptop" { $filesToDownload = @( @{ Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" FileName = "O365ProPlusRetail.img" } ) } "Office" { $filesToDownload = @( @{ Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" FileName = "O365ProPlusRetail.img" } ) } default { Write-Host "Invalid selection." } } foreach ($fileInfo in $filesToDownload) { $filePath = Join-Path $tmpPath $fileInfo.FileName if (-not (Test-Path -Path $filePath -PathType Leaf)) { Invoke-WebRequest -Uri $fileInfo.Url -OutFile $filePath } } }