Reputation: 190
How do I find all the language packs that are installed on my server (windows server 2012) through powershell command? I like to identify(through script) if any of the languages that are required by my services are not installed and then run DISM to add missing language packages.
Upvotes: 2
Views: 34218
Reputation: 31
Added Trim(), required for contains/ notcontains
$languagePacks = (dism /online /Get-Intl) |
?{ $_.Contains("Installed language(s):") } |
%{ $_.Split(":")[1].Trim() }
if( $languagePacks -contains $language) {
Write-host 'installed'
}
Upvotes: 3
Reputation: 6920
You can parse DISM output:
$LangPacks = DISM.exe /Online /Get-Intl /English |
Select-String -SimpleMatch 'Installed language(s)'|
ForEach-Object {
if($_ -match ':\s*(.*)'){$Matches[1]}
}
if($LangPacks -notcontains 'ru-Ru'){
Write-Host 'Language pack not installed!'
}
Upvotes: 6
Reputation: 9298
You should be able to see this by querying WMI, the MUILanguages property in Win32_OperatingSystem I believe shows the installed languages:
$OSInfo = Get-WmiObject -Class Win32_OperatingSystem
$languagePacks = $OSInfo.MUILanguages
$languagePacks
Upvotes: 7
Reputation: 43539
(dism /online /Get-Intl) |
?{ $_.Contains("Installed language(s):") } |
%{ $_.Split(":")[1] }
Upvotes: 1