From 2fc0c0420065420cd15827716c2f7c2eab11276a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 6 Oct 2024 17:46:11 +0200 Subject: [PATCH] run windows11 installer without the need to download the bat manually --- README.md | 6 +++++- windows/installers/runner.ps1 | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f6b46f5..0581a02 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ ## Windows 11 -- Télécharger et lancer [windows11.bat](./windows11.bat) +> Dans l'invite de commande `cmd` + +```batch +PowerShell -Command "Invoke-Expression """"& { $(Invoke-WebRequest -UseBasicParsing 'https://git.mylloon.fr/Anri/confOS/raw/branch/main/windows/installers/runner.ps1') } -Script windows11""""" +``` ### Mise à jour de certains programmes diff --git a/windows/installers/runner.ps1 b/windows/installers/runner.ps1 index 4711c84..c767289 100644 --- a/windows/installers/runner.ps1 +++ b/windows/installers/runner.ps1 @@ -2,14 +2,23 @@ param ( [string]$script ) + $fileName = "$script.bat" -$url = "https://git.mylloon.fr/Anri/confOS/raw/branch/main/windows/installers/$fileName" $filePath = Join-Path -Path $env:TEMP -ChildPath $fileName +$baseUrl = "https://git.mylloon.fr/Anri/confOS/raw/branch/main" + +if ($script -eq "windows11") { + $url = "$baseUrl/$fileName" +} +else { + $url = "$baseUrl/windows/installers/$fileName" +} + + Write-Host "Downloading $fileName..." Invoke-WebRequest -Uri $url -OutFile $filePath Start-Process $filePath -NoNewWindow -Wait; Remove-Item -Path $filePath - exit