fix some stuff

This commit is contained in:
MyDrift 2024-08-19 21:47:48 +02:00
parent 838716e2f4
commit 07b20cd23d
2 changed files with 10 additions and 18 deletions

View File

@ -1,17 +0,0 @@
function Invoke-WinUtilDownloadISO {
param(
$rel,
$locale,
$arch
)
# Download Windows 11 ISO
# Credit: https://github.com/pbatard/Fido
$fidopath = "$env:temp\fido.ps1"
Invoke-Webrequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
& $fidopath -Win "Windows 11" -Rel $rel -Locale $locale -Arch $arch
return "$workingdir\*.iso"
}

View File

@ -78,7 +78,16 @@ function Invoke-WPFGetIso {
}
} elseif ($sync["ISOoption1"].IsChecked) {
# Auto download newest ISO
$filePath = Invoke-WinUtilDownloadISO -rel $rel -locale $locale -arch $arch
# Credit: https://github.com/pbatard/Fido
$fidopath = "$env:temp\Fido.ps1"
Invoke-WebRequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
$selectedItem = ($sync["ISOArchitecture"].SelectedItem -split '-')[0]
$rel = "x" + $selectedItem
# Have to correct the language to actually be a working one
& $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch $rel
$filePath = "$workingdir\*.iso"
}
Write-Host "File path $($filePath)"