PowerShell : obtenir la liste des logiciels installés sur Windows
Il suffit de lire deux clés de la base de registre pour disposer assez simplement en PowerShell de la liste des logiciels installés :
- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall, pour le 32bit ;
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall, pour le 64 bit.
La liste des logiciels installés sur votre système Windows avec PowerShell
Clear-Host $softs=@() $regs='HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\','HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall' ForEach($reg in $regs) { If($reg -Match 'Wow6432Node') { $plateforme=32 } else { $plateforme=64 } $items=Get-ChildItem -Path $reg ForEach($item in $items) { $key=$item.Name -Replace 'HKEY_LOCAL_MACHINE','HKLM:' try { $logiciel=Get-ItemPropertyValue -Path $key -Name 'DisplayName' -ErrorAction SilentlyContinue } catch { } try { $install=Get-ItemPropertyValue -Path $key -Name 'InstallDate' -ErrorAction SilentlyContinue } catch { $install='' } try { $version=Get-ItemPropertyValue -Path $key -Name 'DisplayVersion' -ErrorAction SilentlyContinue } catch { $version='' } If($version) { $softs+=[PSCustomObject]@{logiciel=$logiciel;version=$version;install=$install;plateforme=$plateforme} } } } $softs|Sort -Unique -Property logiciel,version,install|Out-GridView