diff --git a/functions/private/Invoke-WinUtilDownloadISO.ps1 b/functions/private/Invoke-WinUtilDownloadISO.ps1 deleted file mode 100644 index 468f05bc..00000000 --- a/functions/private/Invoke-WinUtilDownloadISO.ps1 +++ /dev/null @@ -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" -} \ No newline at end of file diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index a681d132..5c5d7fa2 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -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)"