In part 2 of this series, we’d like to solve our puzzle – getting installed language packs – by using the built-in PowerShell features. In part 1 we used a console application (dism.exe) which worked but was complex and required Administrator privileges.
An object-oriented approach on Windows machines often is WMI where you query a class that describes the information you need, and get back the information without string conversion. The hard part in WMI is to find the appropriate class name.
Here is our solution:
$os = Get-CIMInstance -ClassName Win32_OperatingSystem $os.MUILanguages
When you compare it to our part 1 solution using dism.exe, you’ll immediately see how much faster and more convenient it is. Yet, both approaches return the very same information at the end.