run windows11 installer without the need to download the bat manually

This commit is contained in:
Mylloon 2024-10-06 17:46:11 +02:00
parent de76261bf4
commit 2fc0c04200
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 16 additions and 3 deletions

View file

@ -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

View file

@ -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