From cb8086ad89355e3758c5ba755214103c3ea3365c Mon Sep 17 00:00:00 2001 From: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Date: Sun, 22 Sep 2024 11:50:35 +0200 Subject: [PATCH] Update functions/public/Invoke-WPFGetIso.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Luka Momčilović --- functions/public/Invoke-WPFGetIso.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index b7d68825f3..9dda75394f 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -99,14 +99,13 @@ function Invoke-WPFGetIso { Set-Location -Path $env:temp # Detect if the first option ("System language") has been selected and get a Fido-approved language from the current culture - if ($sync["ISOLanguage"].SelectedIndex -eq 0) - { - & $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64" -Lang $(Get-FidoLangFromCulture -langName "$((Get-Culture).Name)") -Ed "Windows 11 Home/Pro/Edu" - } - else - { - & $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64" -Lang $sync["ISOLanguage"].SelectedItem -Ed "Windows 11 Home/Pro/Edu" + $lang = if ($sync["ISOLanguage"].SelectedIndex -eq 0) { + Get-FidoLangFromCulture -langName (Get-Culture).Name + } else { + $sync["ISOLanguage"].SelectedItem } + + & $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64" -Lang $lang -Ed "Windows 11 Home/Pro/Edu" Set-Location $originalLocation # Use the FullName property to only grab the file names. Using this property is necessary as, without it, you're passing the usual output of Get-ChildItem # to the variable, and let's be honest, that does NOT exist in the file system