You can also change value of the $ConfirmPreference preference variable.
learn.microsoft.com
Man, something must be wrong with my machine. Even the $confirmpreference set to none, it still prompts. As you see in the screenshot, preference is set to none, yet I still get the prompt
Zay1967:
Man, something must be wrong with my machine. Even the $confirmpreference set to none, it still prompts. As you see in the screenshot, preference is set to none, yet I still get the prompt
Have you tried it in the Powershell console? ISE is not actually the same as the Powershell console. They are very similar, but ISE has some quirks that the console does not have.
Have you tried specifying -Confirm:$false for Set-WinUserLanguageList?
yes, I had the script originally using the Set-WinUserLanguageList -Confirm:$false and it still prompted. Even in powershell got the same prompt
At this point, I won’t bother you anymore, cause this is surely not a script error, but more a computer issue. Thanks for the help though.
Zay1967:
yes, I had the script originally using the Set-WinUserLanguageList -Confirm:$false and it still prompted. Even in powershell got the same prompt
At this point, I won’t bother you anymore, cause this is surely not a script error, but more a computer issue. Thanks for the help though.
I don’t think it is a computer issue, because I get the same behavior.
PS > Set-WinUserLanguageList -LanguageList $test -Confirm:$false
Confirm
Continue with this operation?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): n
Hey can I pick your brain real quick. I need to install about 40 FOD languages. I the array of languages listed out already as you see. So far I am here:
what I am trying to do is use this command DISM /online /add-package /packagepath:pathcab_name.cab and tie it to what I have below so it looks in the folder and array and installs all those languages. I only showed a portion to the list of languages
$langs =
"ar-SA",
"bg-BG",
"cs-CZ",
"da-DK",
"de-DE",
"el-GR",
"en-GB",
"es-ES",
"es-MX",
"et-EE",
"fi-FI",
"fr-CA",
"fr-FR"
foreach ($lang in $langs)
get-childitem -Path $PSScriptRoot | Where-object Name -like "*$lang*" | select-object -ExpandProperty Name
Zay1967:
Hey can I pick your brain real quick. I need to install about 40 FOD languages. I the array of languages listed out already as you see. So far I am here:
what I am trying to do is use this command DISM /online /add-package /packagepath:pathcab_name.cab and tie it to what I have below so it looks in the folder and array and installs all those languages. I only showed a portion to the list of languages
$langs =
"ar-SA",
"bg-BG",
"cs-CZ",
"da-DK",
"de-DE",
"el-GR",
"en-GB",
"es-ES",
"es-MX",
"et-EE",
"fi-FI",
"fr-CA",
"fr-FR"
foreach ($lang in $langs)
get-childitem -Path $PSScriptRoot | Where-object Name -like "*$lang*" | select-object -ExpandProperty Name
I think I understand. Are you asking how to add the DISM command to the script so that it uses $lang?
At the least, I will suggest one change to your script. Don’t put the Get-ChildItem command in your loop, because it will query the same files every time the loop iterates. You need to run it only once and save it in a variable. Then your loop can compare the array to the variable.
If I understand correctly, something like this should do what you want.
$langs ="ar-SA","bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-GB","es-ES","es-MX","et-EE","fi-FI","fr-CA","fr-FR"
$LanguagePacks = get-childitem -Path $PSScriptRoot
foreach ($lang in $langs) {
$Pack = $LanguagePacks | Where-object Name -like "*$lang*" | select-object -ExpandProperty FullName
DISM /online /add-package /packagepath:$Pack