Home > Enterprise >  How to auto answer "yes" in window powershell?
How to auto answer "yes" in window powershell?

Time:09-27

$LanguageList = Get-WinUserLanguageList
$LanguageList.add("En-US")
Set-WinUserLanguageList $LanguageList
$LanguageList = Get-WinUserLanguageList
$LanguageList.Remove($LanguageList[1])
Set-WinUserLanguageList $LanguageList

I can run this code in window powershell just fine but I need to hit "enter" after running code in the lines 3 and 6. So, I want to auto 'yes' in this situation. It will make me run this code without hit "enter" button. I try echo, -confirm$false but it doesn't seem to help me. Please anyone help me. Sorry, If my english is a bit bad. I'm also a newbie for window powershell.

CodePudding user response:

reply to Mathias R. Jessens answer
Whoever wrote and accepted this messed it up. You have to add -Force for Set-WinUserLanguagList. The Docs say Confirm:$false is default, but looks like it does nothing.

  • Related